根据Maven dependency incompatible library class的要求,我尝试了如下所示的阴影插件,但徒劳无功。
fromAsset()
我的目标是用类x.y.z替换a.b.c结构的包。 我在这里错过任何重要配置吗?
答案 0 :(得分:1)
要在着色罐中用 xyz 替换软件包 abc ,您应在maven-shade-plugin上添加 relocations 条目,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<relocations>
<relocation>
<pattern>x.y.z</pattern>
<shadedPattern>a.b.c</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>