我正在尝试遮阳 aws-java-sdk为了按照提到的建议解决库冲突 here .但我看到 maven-shade-plugin ,资源文件(文本)中的条目没有得到更新。例如 request.handler2s 的内容和 request.handlers没有按照搬迁模式进行更改。
maven-shade-plugin 可以更新这些文件(资源文件)吗?如果不是,还有什么其他选择?
pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>com.amazonaws</pattern>
<shadedPattern>com.XX.YY.shaded.com.amazonaws</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
最佳答案
您可以尝试将 ServiceResourceTransformer 添加到您的配置中:
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
关于Maven shade-plugin重定位不更新资源文件中的条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47476402/