- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有 some trouble运行的 Hadoop 作业包含比 Hadoop 发行版 (CDH 5.2) 中包含的版本更新的 Guava 版本。这是一个已知问题。我试着解决它by shading the libraries使用 Maven 阴影插件。因此,我将以下几行添加到我的 pom.xml
中:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>thirdparty.com.google</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
不幸的是,阴影似乎不起作用。当我提取 uber-JAR 时,没有文件夹 thirdparty/com/google
但仍然是文件夹 com/google
。
有人知道出了什么问题吗?
最佳答案
这对我有用:
<relocations>
<relocation>
<pattern>com.google.</pattern>
<shadedPattern>thirdparty.com.google.</shadedPattern>
</relocation>
</relocations>
注意模式末尾的点。
关于java - 为什么使用 maven shade 插件重定位不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27535909/
我正在寻找一种方法来解析字符串以获取 int,然后偶然发现: NumberUtils.toInt("blah",99); 我将它输入到我的 IDE 中,它会自动为我导入它: import autova
我是一名 CS 学生,在我们的期末考试中,我们被告知要通过光线追踪在多个球体上构建反射。这几乎就是我们得到的指导,除了完成后的外观图片。所以我需要球体,它们是反射(使用光线追踪)映射到它们上的,并带有
我正在使用 maven 来配置由多个小型服务组成的应用程序。大多数用 java 开发的服务共享相同的 maven 配置,如在相同的构建生命周期中,一些共享资源(如 spring AMQP)。 所以我在
我正在尝试使用 HBaseTestingUtility 1.2 与 hbase-shaded-client & hbase-shaded-server .它向我抛出了以下异常。谁能告诉我如何避免这种情
当使用 m2eclipse 工具为为 Maven Shade Plugin 配置的项目在 eclipse 中运行 Maven 构建时,构建失败并显示以下错误消息: 无法执行目标 org.apache.
我直接从 apache maven 文档中复制了 maven shade 插件的配置 https://maven.apache.org/plugins/maven-shade-plugin/examp
我试图从 Spring Boot 运行 Hello World 示例。当我在模块上运行“mvn package”时,出现以下错误:- [ERROR] Failed to execute goal or
在尝试构建旧版本的 Apache CXF 2.2.2 时,我一直收到 maven-shade-plugin 使用的 XmlAppendingTransformer 产生的错误:无法连接以获取 ht
我正在尝试使用 maven-shade-plugin 来区分 Java 6 和 Java 7 Artifact 。我的理解来自this link就是原来的神器会被阴影的神器代替 [INFO] Repl
我正在尝试遮阳 aws-java-sdk为了按照提到的建议解决库冲突 here .但我看到 maven-shade-plugin ,资源文件(文本)中的条目没有得到更新。例如 request.hand
我正在寻找一个“神奇”的功能,它可以拍摄图像并返回副本,但将一组色调替换为另一组色调。 例如我有一张红色鱼的照片:它有各种灰度和黑色和白色,但本质上是各种深浅不一的红色。我想将它传递给这个“魔术”函数
开心一刻 有一天螃蟹出门,不小心撞倒了泥鳅泥鳅很生气地说:你是不是瞎啊!螃蟹说:不是啊,我是螃蟹 概述 maven-shade-plugin 官网已经介绍的很详细了,我给大家简单翻译一
开心一刻 有一天螃蟹出门,不小心撞倒了泥鳅泥鳅很生气地说:你是不是瞎啊!螃蟹说:不是啊,我是螃蟹 概述 maven-shade-plugin 官网已经介绍的很详细了,我给大家简单翻译一
我在我的项目中使用 commons-io 并想对其进行着色。我遇到了一个我似乎无法弄清楚的警告: [WARNING] commons-io-2.7.jar, murder-1.0-SNAPSHOT.j
我正在使用 shade 插件创建一个包含所有依赖项的 jar。在我的 pom.xml 中应用此配置相对简单: org.apache.maven.plugins maven-shade-plugin
上下文 我有一个包含多个模块的 IntelliJ 项目。我正在使用 maven-shade-plugin 来压缩依赖项,同时减少 jar 大小。项目结构如下; 顶级父级 (pom)(聚合 api 和
我有一个同时包含Java和Scala组件的maven项目,但是当我使用maven-shade-plugin时,它会同时为Java和Scala文件定位软件包名称,但是仅重命名Java文件中的软件包,Sc
到目前为止,我一直在使用 Maven 程序集插件为每个 Artifact 生成两个 JAR - 已编译的源代码和依赖项 - 原因很简单 - 通过网络仅部署已编译的源代码比部署一体化 JAR 快得多具有
我试图使用Maven Shade并包装ElasticSearch jar。 之所以这样做,是因为我的项目中Lucene版本之间存在冲突。 但是当我使用Shade时发现了问题。它不会更改META-INF
我正在使用 maven-shade-plugin 创建一个可执行 jar,其中包含项目的所有依赖项。有时,这些依赖项会带来自己的依赖项,这些依赖项会与其他库的依赖项发生冲突,并且 maven-shad
我是一名优秀的程序员,十分优秀!