我正在尝试创建一个可部署的jar文件,其中使用了Apache的commons-lang3库。然而,我的AWS集群没有这个库,所以我遇到了类NotFoundException的问题。我想我需要手动添加依赖项,但是我在使用maven shade插件时遇到了问题(有人建议我使用它)。我的当前pom文件如下:
<dependency>
<groupId>org.apache.pig</groupId>
<artifactId>pig</artifactId>
<version>0.12.0-cdh5.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<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>
<artifact>org.apache.commons:commons-lang3</artifact>
<includes>
<include>org/apache/commons/commons-lang3/3.4/*</include>
</includes>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
我想要一个完全正常的jar包,并嵌入commons-lang3库。我是不是做错了什么?