1
我試圖在使用Maven Shade插件構建超級jar時排除一系列工件。下面是我使用這個配置:使用Maven Shade插件排除工件未按預期方式工作
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<artifactSet>
<excludes>
<exclude>com.fasterxml.jackson.core:jackson-core:jar:2.4.5</exclude>
</excludes>
</artifactSet>
...
剔除包沒有版本信息的作品:
<exclude>com.fasterxml.jackson.core:jackson-core</exclude>
但不幸的是,由於有不同的版本,做的神器是不是一種選擇需要包括在內。
感謝伊戈爾,具體使用依賴管理確實是這裏的解決方案。儘管Maven Shade插件中仍然存在一些錯誤(或者文檔缺乏清晰度),但我想因爲有一個解決方法,它不是世界的盡頭。 –