【问题标题】:p2-maven-plugin fails with hadoopp2-maven-plugin 因 hadoop 而失败
【发布时间】:2016-04-10 14:08:33
【问题描述】:

如果我将 hadoop-annotations 作为(传递)依赖项包含在内,使用 mvn p2:site 运行 p2-maven-plugin 会失败:

[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]

我该如何解决这个问题?

【问题讨论】:

    标签: maven hadoop p2


    【解决方案1】:

    hadoop-annotations 依赖于 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-plugin 配置中排除这个:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      • 2018-11-04
      • 2016-08-20
      • 2023-04-05
      • 1970-01-01
      • 2012-10-18
      • 2014-11-21
      相关资源
      最近更新 更多