gpt4 book ai didi

java - pom中如何配置maven-release-plugin模拟命令行中的-Dgoals=deploy

转载 作者:行者123 更新时间:2023-11-30 11:25:51 24 4
gpt4 key购买 nike

我正在尝试将 maven-release-plugin 的 perform mojo 在 pom 中配置为 执行 deploy 目标(相对于默认的 deploy site-deploy)。从命令行,它就像下面这样简单:

mvn release:perform -Dgoals=deploy


以下是配置 pom 的尝试,但都失败了。

尝试 1:

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<arguments>-Dgoals=deploy -Dgit.tag.previous=</arguments>
</configuration>
</execution>
</executions>
<configuration>
<preparationGoals>clean install</preparationGoals>
<arguments>-Dgit.tag.previous=</arguments>
</configuration>
</plugin>
</plugins>
</pluginManagement>
...
</build>

尝试 2:

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4</version>
<configuration>
<preparationGoals>clean install</preparationGoals>
<arguments>-Dgoals=deploy -Dgit.tag.previous=</arguments>
</configuration>
</plugin>
</plugins>
</pluginManagement>
...
</build>

尽管配置发生了这些变化,当我执行 mvn release:perform 时,我仍然看到以下日志行:

....
[INFO] Executing goals 'deploy site-deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building SearchService
[INFO] [INFO] task-segment: [deploy, site-deploy]
[INFO] [INFO] ------------------------------------------------------------------------
...

注意任务段中的“站点部署”。


非常感谢任何帮助!

最佳答案

您的想法太复杂了。 perform#goals描述你想要什么。所以这只是

<configuration>
<goals>deploy</goals>
</configuration>

关于java - pom中如何配置maven-release-plugin模拟命令行中的-Dgoals=deploy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20103818/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com