赞
踩
mvn仓库关闭了redeploy, 经常会遇到一些400错误,其中一个原因是一次deploy动作会执行两次sources包的发布。
原因是因为重复定义了maven-source-plugin插件,or 引入 maven-shade-plugin 导致source 执行了两次
如何判断顶级自己继承的顶级pom里有没有这个插件,除了直接看顶级pom的内容,还可以用命令: mvn help:effective-pom 看实际生效pom的完整内容。
由于希望将多个jar 发布到一起,导致当前spi 工程source 执行一次、maven-shade-plugin 又执行了一次?
<packaging>jar</packaging> <groupId>xxxxx</groupId> <artifactId>xxx-shade</artifactId> <version>${revision}</version> <dependencies> <dependency> <groupId>com.xxxx</groupId> <artifactId>xxx-spi</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.1.0</version> <configuration> <createDependencyReducedPom>false</createDependencyReducedPom> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <createSourcesJar>true</createSourcesJar> <shadeSourcesContent>true</shadeSourcesContent> </configuration> </execution> </executions> </plugin> </plugins> </build>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。