使用Maven Shade插件3.6.0
我有以下过滤器:
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.class</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF.versions.9.module-info</exclude>
</excludes>
</filter>
</filters>
但是,我仍然看到以下警告:
classgraph-4.8.160.jar、jackson-core-2.17.0.jar、jackson-databind-2.15.2.jar、jackson-datatype-jdk8-2.15.2.jar、jackson-datatype-jsr310-2.15.2 .jar,jackson-module-parameter-names-2.15.2.jar 定义 1 个重叠类: [警告] - META-INF.versions.9.module-info
这是良性的,但如果可能的话我仍然想消除警告。我做错了什么?
使用的过滤器使用错误。
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.class</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/versions/9/module-info.class</exclude>
</excludes>
</filter>
</filters>
或者排除多版本 jar 的所有类型的
module-info.class
文件:
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.class</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/versions/**/module-info.class</exclude>
</excludes>
</filter>
</filters>