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/

相关文章:

eclipse - 将动态 Web 项目转换为 Maven = 部署为空

java - NetBeans + Glassfish --> NoSuchMethodError directExecutor()Ljava/util/concurrent/Executor

ubuntu - 将 Amazon EC2 EBS Ubuntu 迁移到 Microsoft Azure

java - 创建一个 'Empty Shell' Jar

Maven 与 Cargo 和安装的 Glassfish

amazon-web-services - AWS Cognito工作流程:使用电子邮件别名作为主要用户名

amazon-web-services - 为什么有相同的安全组,VPC 中怎么可能有不同的安全组?

apache-flink - Apache Flink(如何唯一标记作业)

java - Apache Flink 表查询结果作为字符串值

java - Flink 中的 LeftOuterJoin(JAVA API)