编译Hive mvn clean包时出错-Pdist

时间:2015-11-28 05:46:10

标签: maven hive

在ubuntu上编译Hive期间我运行此命令。

    $ git clone https://git-wip-us.apache.org/repos/asf/hive.git
    $ cd hive
    $ mvn clean package -Pdist

然后我得到这个错误

    [INFO] Reactor Summary:
    [INFO]
    [INFO] Hive .............................................. SUCCESS [5.461s]
    [INFO] Hive Shims Common ................................. SUCCESS [10.078s]
    [INFO] Hive Shims 0.23 ................................... SUCCESS [5.099s]
    [INFO] Hive Shims Scheduler .............................. SUCCESS [1.569s]
    [INFO] Hive Shims ........................................ SUCCESS [0.728s]
    [INFO] Hive Storage API .................................. SUCCESS [3.465s]
    [INFO] Hive Common ....................................... SUCCESS [1:08.210s]
    [INFO] Hive Serde ........................................ SUCCESS [1:34.094s]
    [INFO] Hive Metastore .................................... SUCCESS [2:48.406s]
    [INFO] Hive Ant Utilities ................................ SUCCESS [0.606s]
    [INFO] Hive Llap Client .................................. SUCCESS [2.148s]
    [INFO] Spark Remote Client ............................... SUCCESS [29.152s]
    [INFO] Hive Query Language ............................... FAILURE [1:41.379s]
    [INFO] Hive Service ...................................... SKIPPED
    [INFO] Hive Accumulo Handler ............................. SKIPPED

...

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project hive-exec: Compilation failure

如何修复此错误可以帮助我!

2 个答案:

答案 0 :(得分:1)

Maven编译器插件内存不足。您可以为root pom.xml中的编译器插件配置进行以下更改,从而为其分配更多内存。

第738行

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>${maven.compiler.plugin.version}</version>
  <configuration>
    <source>1.7</source>
    <target>1.7</target>
    <jvmArgs>-Xmx2048m -Xms512m</jvmArgs><!--increasing memory-->
  </configuration>
</plugin>

我已将其设置为2GB,这可能有点矫枉过正,但先尝试一下。 还可以使用以下命令尝试在没有测试的情况下运行构建。

mvn clean package -Pdist -Dmaven.test.skip=true

-Dmaven.test.skip将跳过运行测试用例并更快地生成构建结果。

答案 1 :(得分:0)

当我没有指定Hadoop版本并使用此命令跳过测试用例时构建成功:

mvn clean package -DskipTests