Maven shade-plugin重定位不更新资源文件中的条目

标签 maven amazon-web-services apache-flink maven-shade-plugin aws-java-sdk

我正在尝试遮阳 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/

相关文章:

apache-flink - 在 Apache Flink 中从 HDFS 地址流式传输文件

apache-flink - Flink 如何处理托管状态的序列化?

java - 使用 selenium 的 Java 测试项目和使用 selenium 的 Java Maven 测试项目有什么区别

ruby-on-rails - 使用 Rails 和 Paperclip 的 s3 的简单 Amazon IAM 策略

amazon-web-services - AWS CFN 错误 "The parameter groupName cannot be used with the parameter subnet"

wordpress - 加载 Assets 的 Wordpress 中的 EC2 AWS SSL 问题

elasticsearch - apache flink、elasticsearch 和 kafka 集成的版本

maven - maven 构建中的未知主机异常 nexus.codehaus.org

java - GWT maven 项目的客户端断点可以在 Eclipse 中工作,但不能在 Netbeans 中工作

java - 在 Intellij IDEA 中运行 Maven 目标的键盘快捷方式?