gpt4 book ai didi

java - org.apache.maven.plugin.MojoExecutionException : protoc failure

转载 作者:可可西里 更新时间:2023-11-01 14:13:29 32 4
gpt4 key购买 nike

我在使用maven从源代码编译hadoop时遇到了一些问题。这是错误,任何人都可以帮助我吗?谢谢。

[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-c
[Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAP
plugin.MojoExecutionException: protoc failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.apache.maven.plugin.MojoExecutionException: protoc failure
at org.apache.hadoop.maven.plugin.protoc.ProtocMojo.execute(ProtocMojo.java:81)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
**Caused by: org.apache.maven.plugin.MojoExecutionException: protoc failure**
at org.apache.hadoop.maven.plugin.protoc.ProtocMojo.execute(ProtocMojo.java:78)
... 21 more
[ERROR]
[ERROR]

最佳答案

说明位于 http://wiki.apache.org/hadoop/HowToContribute解释构建 hadoop 的一些不太明显的方面——包括这一方面。 这里的主要问题是 hadoop 的 YARN 框架需要 Protocol Buffer ,而您很可能没有安装它们。

看来问题可能出在您没有正确解释错误,所以——

如何隔离构建错误

任何失败的 mojo 都应该与一个类相关联。

在这种情况下,失败的原因就在这里:

https://svn.apache.org/repos/asf/hadoop/common/trunk/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java

查看代码,很明显这个 Mojo 需要“protoc”程序才能运行。

http://code.google.com/p/protobuf/

解决方案

要构建 hadoop,您需要 Protocol Buffer 。这可以通过运行以下命令从 googlecode(取自 http://numbers.brighterplanet.com/2012/04/14/how-to-install-mosh-on-amazon-ec2/ )获取代码,从源代码安装在 *NIX 机器上。

wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
tar xzf protobuf-2.4.1.tar.gz
cd protobuf-2.4.1
./configure
make
sudo make install
sudo ldconfig

关于java - org.apache.maven.plugin.MojoExecutionException : protoc failure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15745010/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com