我需要使用比目前与hadoop-common捆绑的更新版本的jsch。
当我使用hadoop jar
开展工作时,我使用export HADOOP_CLASSPATH=path/to/jsch-0.1.51.jar:$HADOOP_CLASSPATH
和export HADOOP_USER_CLASSPATH_FIRST=true
并且工作正常。
但我无法在Oozie工作流程中使其工作。我将jsch-0.1.51.jar放在我的Oozie工作流工作区的lib目录中,但它最后在类路径中加载。我也试过oozie.libpath
但没有成功。
答案 0 :(得分:0)
我用maven-shade-plugin解决了我的问题:
<build>
<plugins>
<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>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>foo.bar.Main</mainClass>
</transformer>
</transformers>
<relocations>
<relocation>
<pattern>com.jcraft.jsch</pattern>
<shadedPattern>shaded.com.jcraft.jsch</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>