Thứ Năm, 27 tháng 2, 2014

Issue:

if I run some specific maven task for example mvn clean install findbugs:findbugs (If I run only mvn clean install then there is no such message)
I know that the problem is that this POM does not exists, because it is only defined to hold the mapping information. (m2e lifecycle-mapping not found)
Anyway, I want to keep my build clean, without any warnings, so how can I get rid of this specific one? (My CI server checks that there is no warning.)
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
which is confusing. When you run a CI server, people will come and ask what these warnings mean. So I created a dummy nonsense plugin, just to provide a valid plugin which will do nothing.

Solution:

The easiest way is to checkout the repository and run mvn install or mvn deploy -DaltDeploymentRepository=REPOID::default::PLUGIN_REPO_URL.
Otherwise you may download the pom and the binary jar and run:
  • mvn install:install-file -DpomFile=pom.xml -Dfile=lifecycle-mapping-1.0.0.jar or
  • mvn deploy:deploy-file -DpomFile=pom.xml -Dfile=lifecycle-mapping-1.0.0.jar -DrepositoryId=REPO_ID -Durl=PLUGIN_REPO

Maven Eclipse Error - Unsupported IClasspathEntry / Nullpointer

Error message box appears while importing maven project having message:


An internal error occurred during: "Updating Maven Project".
Unsupported IClasspathEntry kind=4

Solution: 

  1. Right-click on your project, select Maven -> Remove Maven Nature.
  2. Open you terminal, go to your project folder and do “mvn eclipse:clean”. (NOTE: You will get error in the eclipse IDE for missing files. But, donot worry about that. It will be resolved after next step)
  3. Right click on your Project and select “Configure -> Convert into Maven Project

Result: 

Main error about classpath entry will be resolved.