我正在考虑用nexus maven-plugin替换maven-deploy-plugin。
现在,我的项目的一些子模块(例如集成测试模块)不会部署到Nexus服务器。我过去常常通过"maven.deploy.skip“属性禁用这些模块的部署。不过,我找不到任何可以与nexus maven-plugin相媲美的东西。是否有其他方法可以使用此插件跳过部署中的单个模块?
我还尝试将插件绑定到伪阶段"none“,如here所述,但是检查有效的POM时,仍然存在插件的注入执行(我假设这是由于它替换现有部署插件的方式所致)。
发布于 2014-12-19 07:08:55
您可以将给定子模块的配置属性skipNexusStagingDeployMojo设置为true。请参阅the Nexus book chapter about deployment to staging中记录的更多配置属性。
发布于 2019-01-02 12:22:44
我发现处理nexus staging- Maven -plugin局限性的最简单方法是将您不想部署到单独的Maven配置文件中的任何模块隔离开来,并在部署发生时将其排除。示例:
<profile>
<id>no-deploy</id>
<!--
According to https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin
skipNexusStagingDeployMojo may not be set to true in the last reactor module. Because we don't
want to deploy our last module, nor a dummy module, we simply omit the relevant modules when
a deploy is in progress.
-->
<activation>
<property>
<name>!deploy</name>
</property>
</activation>
<modules>
<module>test</module>
<module>benchmark</module>
</modules>
</profile>在上面的示例中,我避免构建和部署"test“和"benchmark”模块。如果您希望在不部署单元测试的情况下运行它们,请使用单独的运行:
mvn test
mvn -Ddeploy deploy发布于 2018-09-05 17:43:50
面临着类似的问题。适用于我的解决方案是在需要从部署任务中排除的模块中添加部署插件,并将skip设置为true。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>https://stackoverflow.com/questions/25305850
复制相似问题