热通过CMD禁用buildnumber - Maven的插件 [英] Hot to disable buildnumber-maven-plugin through cmd
问题描述
我对Maven的问题。如何禁用通过命令行选项buildnumber-Maven的插件。我想我们的持续集成服务器上运行MVN测试的命令,但该CMD失败,因为它试图建立一个版本,并没有访问权限的VCS我们(在标签配置)。因此,可以通过CMD选项来禁用它,或者不建立新的发行版本只运行测试?感谢您的帮助。
I have question about maven. How can I disable buildnumber-maven-plugin through command line option. I want to run "mvn test" command on our continuous integration server, but this cmd failed because it trying to build a version and haven't access permission to our vcs (which is configured in tag). So it is possible disable it through cmd option or run only the tests without building new release version? Thanks for any help.
推荐答案
使用配置文件来控制哪些插件在构建过程中启用:
Use a profile to control which plug-ins are enabled during the build:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.me.test</groupId>
<artifactId>demo</artifactId>
<version>1.0</version>
..
..
<profiles>
<profile>
<id>with-scm</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>true</doUpdate>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
该配置文件可以通过运行Maven的如下启用:
The profile can be enabled by running Maven as follows:
mvn -Pwith-scm package
这篇关于热通过CMD禁用buildnumber - Maven的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!