我对 Maven 配置文件没有太多经验......我不知道 Maven 是否可以做到这一点,但它绝对对我有用......
是否可以定义一个配置文件,该配置文件在调用时会自动运行 Maven 发布插件准备目标?
我解释得更好......
代替:
mvn release: prepare
我想打电话
mvn install-pProfileThatPerformThePrepare
自动执行准备...
谢谢....
我对 Maven 配置文件没有太多经验......我不知道 Maven 是否可以做到这一点,但它绝对对我有用......
是否可以定义一个配置文件,该配置文件在调用时会自动运行 Maven 发布插件准备目标?
我解释得更好......
代替:
mvn release: prepare
我想打电话
mvn install-pProfileThatPerformThePrepare
自动执行准备...
谢谢....
您只需要将插件的执行绑定到一个阶段(例如,您的示例中的“安装”):
<profile>
<id>my-profile</id>
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>prepare</goal>
</goals>
<configuration>
<updateWorkingCopyVersions>false</updateWorkingCopyVersions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>