p2 maven插件与hadoop一起失败

slhcrj9b  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(369)

如果我将hadoop注解作为一个(可传递的)依赖项,那么运行p2maven插件 mvn p2:site 失败:

[info] Executing Bundler:
[info]   [EXEC] hadoop-common-2.7.1.jar
[warn]  : Superfluous export-package instructions: [org.apache, org.apache.hadoop.io.file, org]
[info] Executing Bundler:
[info]   [EXEC] hadoop-annotations-2.7.1.jar
[warn]  : Superfluous export-package instructions: [org.apache.hadoop, org, org.apache]
[info] Executing Bundler:
[info]   [EXEC] tools.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.235 s
[INFO] Finished at: 2016-01-06T13:09:37+01:00
[INFO] Final Memory: 25M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.reficio:p2-maven-plugin:1.2.0-SNAPSHOT:site (default-cli) on project com.incquerylabs.capellabenchmark.dependencies: Execution default-cli of goal org.reficio:p2-maven-plugin:1.2.0-SNAPSHOT:site failed: java.lang.RuntimeException: Error while bundling jar or source: tools.jar: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/jre/../lib/tools.jar.78edbbdc-bfbf-46f3-8f9b-35681a60baf5 (Permission denied) -> [Help 1]

我怎样才能解决这个问题?

v64noz0r

v64noz0r1#

hadoop注解依赖于jdk jar:

<dependency>
  <groupId>jdk.tools</groupId>
  <artifactId>jdk.tools</artifactId>
  <version>1.6</version>
  <scope>system</scope>
  <systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

必须在p2 maven插件配置中排除此项:

<artifact>
    <id>{artifact that depends on hadoop-annotations}</id>
    <excludes>
        <exclude>jdk.tools:jdk.tools</exclude> <!-- workaround for hadoop-annotations -->
    </excludes>
</artifact>

相关问题