最近,我们根据https://issues.apache.org/jira/browse/MNG-5940将maven版本改为3.5.4
在Maven Super POM中,maven-source-plugin jar目标已更改为jar-no-fork
我们有公司的pom大师:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>哪一个我不能改变。和maven超级pom一起在有效的pom中
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
<goal>jar</goal>
</goals>
</execution>
</executions>
<inherited>true</inherited>
</plugin>在发布期间,源代码生成了两次(一个文件覆盖了第二个文件),但在部署到Artifactory时,我得到了错误,因为没有覆盖工件的权限。
我可以配置一些我的pom来禁用插件的一个目标吗?
发布于 2019-09-13 17:26:12
您需要从您的父pom中删除执行(删除默认阶段就足够了),并使用新目标添加新的执行:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase/>
</execution>
<execution>
<id>custom-attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
<inherited>true</inherited>
</plugin>https://stackoverflow.com/questions/57920117
复制相似问题