0
這應該很容易,但我遇到來自maven-install插件的奇怪行爲。我怎麼能mvn:安裝陰影maven神器
我需要重新包裝一些常見的依賴到我的項目,以避免依賴衝突。爲此我用遮陽插件與配置的重新定位:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>do_shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createSourcesJar>true</createSourcesJar>
<relocations>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>com.myproject.google.common</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>com.myproject.commons</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
樹蔭插件做了它的工作正常並製作陰影假象com.myproject-的myproject-的.jar和dependecy減少的POM文件。 但是,然後安裝插件安裝原始神器(不依賴)而不是陰影。
進一步,在此之前安裝的插件問題,我的CI服務器(詹金斯)建項目和正確發佈的陰影僞影和依賴性降低POM的Nexus倉庫(!!)。所以現在我從nexus下載工件,我的本地倉庫中會有正確的罐子,但是如果我使用安裝插件,罐子將不會很好。
有沒有人有類似的問題?有誰知道如何解決他們?