我正在尝试使用Maven Shade插件打包我的项目 .

我已经在POM xml中配置它并运行'package'目标来获取可执行jar .

当我在运行包目标后检查控制台时,我发现我在我的pom中重复了jar,而shade插件只保留了第一个依赖,而不是两者 .

我尝试运行它,因为依赖性而失败 .

是否有Maven阴影中的任何配置,我可以通过它保持可执行jar中的原始和重复依赖 .

TIA

编辑:我已经包含了声明重复依赖的控制台 .

[WARNING] maven-shade-plugin has detected that some .class files
[WARNING] are present in two or more JARs. When this happens, only
[WARNING] one single version of the class is copied in the uberjar.
[WARNING] Usually this is not harmful and you can skip these
[WARNING] warnings, otherwise try to manually exclude artifacts
[WARNING] based on mvn dependency:tree -Ddetail=true and the above

我正在尝试从spring hibernate项目创建一个可执行jar

编辑#2:失败不是因为依赖,这是因为我错过了 spring 资源的变形金刚 . 但是,如果我们可以将Maven Shade配置为具有重复的类,我仍然很好奇 . 谢谢 .