maven in command line succeed, but failed when using the same maven in eclipse - eclipse

I'm trying to build the project of hadoop. I followed the official document as follows on how to do that.
http://wiki.apache.org/hadoop/HowToContribute
https://wiki.apache.org/hadoop/EclipseEnvironment
I've git clone the project, maven install it successfully, but when I import the project, or even a sub-project like 'hadoop-yarn-api', I got the following errors on maven:
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (execution: compile-protoc, phase: generate-sources) pom.xml /hadoop-yarn-api line 73 Maven Project Build Lifecycle Mapping Problem
Then I'm trying to mvn clean install the project via External Tools Configuration in eclipse, it also failed on:
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-yarn-api: org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did not return a version -> [Help 1]
But the curious part is that when I cd into the root directory of 'hadoop-yarn-api' and invoke mvn clean install, it can be built successfully.
I'm using m2ecipse in eclipse, and I'm sure that I've changed to the maven which is exactly the one that I'm used in command line, not the embedded one.
And I've installed protocol buffers 2.5.0:
$ protoc --version
libprotoc 2.5.0
Could anyone give me some idea? Many thanks!
P.S.
Eclipse Java EE IDE - Juno Service Release 2
m2e - 1.4.1.20140328-1905
Mac 1- 0.9.4
maven - 3.0.5
Hadoop - 2.2.0

Related

Google Cloud Sample App - Plugin not covered by lifecycle configuration

I am trying to build the JAVA sample apps provided for Google Cloud Platform at https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/storage/cloud-client
I have installed maven 3.5 and was able to build and run it from the command line with the steps mentioned in the README
However when I try to import and build the project in eclipse, I get the following error in the pom.xml :
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (execution: default-compile, phase: compile) pom.xml /datastore-google-cloud-samples line 23 Maven Project Build Lifecycle Mapping Problem
The details of eclipse I am using are:
Version:
Neon.3 Release (4.6.3)
Build id: 20170314-1500
I looked at the following answer:
How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds
and added the pluginManagement tag in my pom.xml, however I still got the same error.
Is there any step which I am missing here?
Is there any particular setting which needs to be done in eclipse to use it with maven and/or google cloud?

Spring tool suit could not build with maven

my project can be built from the command line with maven clean install but i cannot update it through maven-> update project. it says
Could not calculate build plan: Plugin
org.apache.maven.plugins:maven-resources-plugin:2.4 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-resources-plugin:jar:2.4
i have tried installing maven-resources-plugin.jar manually to the repository, still its the same.

jbake plugin requires maven upgrade in eclipse

I'm using a maven plugin in my POM file. When I build the project, I get an error:
`[ERROR] Failed to execute goal br.com.ingenieux:jbake-maven-plugin:0.0.9:generate (default-cli) on project uts-documentation: The plugin br.com.ingenieux:jbake-maven-plugin:0.0.9 requires Maven version 3.1.1 -> [Help 1]`
My embedded maven version is 3.0.4. How can I update to the required version without installing a separate instance of maven (would like to avoid that if possible)?
Upgrading to a more recent Eclipse version will bring an updated embedded version of Maven. For example the Eclipse Luna installation that I am running has Maven 3.2.1 embedded.

ejb-javaee6 with error when generated by eclipse

When I create an ejb project through ejb-javaee6 archetype in Eclipse I get the following errors:
Description Resource Path Location Type
Endorsed directory '/home/hfluz/workspace/maven-test/web2/target/endorsed' is missing. You may need to a perform a Maven command line build in order to create it. pom.xml /web2 line 28 Maven Configuration Problem
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-dependency-plugin:2.1:copy (execution: default, phase: validate) pom.xml /web2 line 53 Maven Project Build Lifecycle Mapping Problem
There is already an /target/endorsed/javaee-endorsed-api-6.0.jar file.
IDE: JBoss Developer Studio 7 Beta 1 (tried with embedded 3.0.4 maven version and also with 3.0.5).
When I generate this same archetype through command line (maven 3.0.4) and import the project to eclipse, these errors are not displayed.
I just tried and the same happens with webapp-javaee6 archetype (also from org.codehaus.mojo.archetypes).
Anyone have any idea about what is causing this issue?
Try refreshing the target folder in eclipse (workspace seems out of sync).
Read http://docs.jboss.org/tools/whatsnew/maven/maven-news-3.3.0.CR1.html about endorsed library support in JBDS/JBT

Hadoop and Eclipse environment

Trying to configure Eclipse and Hadoop, following this site.
I successfully ran:
git clone git://git.apache.org/hadoop-common.git
Now I get a failure on:
mvn install -DskipTests
[INFO] Apache Hadoop Main ................................ SUCCESS [6.688s]
[INFO] Apache Hadoop Project POM ......................... FAILURE [1.548s]
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (create-testdirs) on project hadoop-project: Error executing ant tasks: /usr/local/hadoop/hadoop-common/hadoop-project/target/antrun/build-main.xml (No such file or directory) -> [Help 1]
The reason being I don't have a "target" folder in .../hadoop-project. My /hadoop-project folder contains only a "src" folder and that's it.
So it appears that folder was not established. Any ideas? Here is the environment:
Ubuntu 12.1
Hadoop 1.0.4
Maven 3.0.4
The site mentioned in the query is for development of Hadoop and not for developing applications using Hadoop. There is a difference between the two.
Here are the instructions for for developing/debugging MapReduce programs in Eclipse. Note that the procedure applies for Linux OS only.