Maven-release-plugin在提交之前自动运行脚本

拉罗克

我想知道是否有可能maven-release-plugin在提交新标记之前使运行成为特定脚本。

原因是,我有一个Dockerfile,我想用我的项目的新版本进行更新。

A_Di-Matteo

您可以使用目标completionGoals选项release:perform

在转换回下一个开发版本之后但在提交之前,要在准备步骤完成时运行目标。空格分隔。

maven-exec-plugin通过其exec目标执行脚本

一个简单的例子如下:

<build>
    <plugins>
        ....
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.5.0</version>
            <configuration>
                <!-- example: executing an hello message on Windows console -->
                <executable>cmd</executable>
                <arguments>
                    <argument>/C</argument>
                    <argument>echo</argument>
                    <argument>hello</argument>
                </arguments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
                ...
                <completionGoals>exec:exec</completionGoals>
            </configuration>
        </plugin>
    </plugins>
</build>

注意completionGoals上面的值,我们实际上是告诉Maven也执行exec插件及其exec目标,然后它将如上选择我们的全局配置。

在您的情况下,上面的exec配置如下所示:

<configuration>
    <executable>your-script</executable>
    <!-- optional -->
    <workingDirectory>/tmp</workingDirectory>
    <arguments>
        <argument>-X</argument>
        <argument>myproject:dist</argument>
    </arguments>
</configuration>

根据发布准备的确切时间,您还可以考虑使用其他preparationGoals配置选项:

在转换之后但在提交之前,将目标作为准备步骤的一部分运行。空格分隔。

其默认值为clean verify,则为clean verify exec:exec

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Jenkins管道中使用Maven Release Plugin

来自分类Dev

创建Maven-release-plugin标签

来自分类Dev

maven-release-plugin将快照部署到archiva

来自分类Dev

在pom中使用的Jenkins Maven-release-plugin -D属性

来自分类Dev

在git-1.8.5中使用Maven-release-plugin

来自分类Dev

将Maven-release-plugin添加到Android Studio

来自分类Dev

如何阻止 maven-release-plugin 使用旧版本的 maven-gpg-plugin

来自分类常见问题

"You don't have a SNAPSHOT project in the reactor projects list." when using Jenkins Maven release plugin

来自分类Dev

在执行Maven-release-plugin的目标期间如何关闭配置文件

来自分类Dev

多模块项目中的maven-release-plugin,每个模块都有单独的git存储库

来自分类Dev

maven-release-plugin不使用作业配置或/和.ssh / config中提供的ssh密钥

来自分类Dev

在GitHub上使用maven-release-plugin“您不能推送到git://github.com / ...”

来自分类Dev

Maven-surefire-plugin在SpringBoot 2.2.2.RELEASE及更高版本中不起作用

来自分类Dev

为什么maven-release-plugin上传构建信息?可以将其删除吗?

来自分类Dev

在GitHub上使用maven-release-plugin“您不能推送到git://github.com / ...”

来自分类Dev

maven-release-plugin:2.5:prepare失败,并显示“写入POM时出错:(访问被拒绝)”

来自分类Dev

gradle-release插件+ Maven发布插件

来自分类Dev

当我使用maven-release-plugin释放分支时,为什么它尝试从修订版0创建分支?

来自分类Dev

在插件org.springframework.boot:spring-boot-maven-plugin:1.1.4.RELEASE中找不到目标''

来自分类Dev

在Jenkins中将Maven-release-plugin与完整性(MKS)一起用作源代码管理

来自分类Dev

在插件org.springframework.boot:spring-boot-maven-plugin:1.1.4.RELEASE中找不到目标''

来自分类Dev

不存在的标签的Maven Release插件“标签已存在”

来自分类Dev

Maven Release Build Skip测试用例失败-Jenkins

来自分类Dev

非交互模式下的Maven Release-Plug用法

来自分类Dev

Maven的有JDK11:javac的:无效标志:--release

来自分类Dev

“ maven.compiler.release”替代源和目标?

来自分类Dev

在多模块项目上使用Maven Release插件

来自分类Dev

不存在的标签的Maven Release插件“标签已存在”

来自分类Dev

是Maven release:branch应该更新分支的scm url吗?

Related 相关文章

  1. 1

    Jenkins管道中使用Maven Release Plugin

  2. 2

    创建Maven-release-plugin标签

  3. 3

    maven-release-plugin将快照部署到archiva

  4. 4

    在pom中使用的Jenkins Maven-release-plugin -D属性

  5. 5

    在git-1.8.5中使用Maven-release-plugin

  6. 6

    将Maven-release-plugin添加到Android Studio

  7. 7

    如何阻止 maven-release-plugin 使用旧版本的 maven-gpg-plugin

  8. 8

    "You don't have a SNAPSHOT project in the reactor projects list." when using Jenkins Maven release plugin

  9. 9

    在执行Maven-release-plugin的目标期间如何关闭配置文件

  10. 10

    多模块项目中的maven-release-plugin,每个模块都有单独的git存储库

  11. 11

    maven-release-plugin不使用作业配置或/和.ssh / config中提供的ssh密钥

  12. 12

    在GitHub上使用maven-release-plugin“您不能推送到git://github.com / ...”

  13. 13

    Maven-surefire-plugin在SpringBoot 2.2.2.RELEASE及更高版本中不起作用

  14. 14

    为什么maven-release-plugin上传构建信息?可以将其删除吗?

  15. 15

    在GitHub上使用maven-release-plugin“您不能推送到git://github.com / ...”

  16. 16

    maven-release-plugin:2.5:prepare失败,并显示“写入POM时出错:(访问被拒绝)”

  17. 17

    gradle-release插件+ Maven发布插件

  18. 18

    当我使用maven-release-plugin释放分支时,为什么它尝试从修订版0创建分支?

  19. 19

    在插件org.springframework.boot:spring-boot-maven-plugin:1.1.4.RELEASE中找不到目标''

  20. 20

    在Jenkins中将Maven-release-plugin与完整性(MKS)一起用作源代码管理

  21. 21

    在插件org.springframework.boot:spring-boot-maven-plugin:1.1.4.RELEASE中找不到目标''

  22. 22

    不存在的标签的Maven Release插件“标签已存在”

  23. 23

    Maven Release Build Skip测试用例失败-Jenkins

  24. 24

    非交互模式下的Maven Release-Plug用法

  25. 25

    Maven的有JDK11:javac的:无效标志:--release

  26. 26

    “ maven.compiler.release”替代源和目标?

  27. 27

    在多模块项目上使用Maven Release插件

  28. 28

    不存在的标签的Maven Release插件“标签已存在”

  29. 29

    是Maven release:branch应该更新分支的scm url吗?

热门标签

归档