1、当打一个 module 下的包时,本项目下的其他module也不能有错误。放到maven中的项目下会显示具体报的哪个错,然后去修改就行。
2、当出现下面的错误时。
需要在 pom 文件中加入这个依赖。注意,版本号要修改,不然会报错,我之前用的是 3.0.1 有报错,不知道其他版本会不会报错,调成这个版本后就不报错了。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.class</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>