maven eclipse:eclipse maven-eclipse-plugin 2.9 NullPointerException
If you have difficulties to generate eclipse project files (.project and .classpath) from a maven project on a debian based OS, this article is for you.
While running mvn eclipse:eclipse in my peers project, I was stuck with this issue:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.872s
[INFO] Finished at: Wed Oct 03 23:39:07 CEST 2012
[INFO] Final Memory: 10M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse (default-cli) on project peers-doc: Execution default-cli of goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse failed. NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Actually, apparently, maven automatically seeks jvm instances on a debian host (in /usr/lib/jvm) and tries to extract MANIFEST.MF file from jre/lib/rt.jar file in each jvm folder.
It should be verified, but apparently, as soon as it finds an rt.jar file without manifest, it fails with this annoying NullPointerException.
I found that my system had 4 different JVMs:
- java-1.5.0-gcj-4.4
- java-6-openjdk
- java-6-sun-1.6.0.26
- jdk1.7.0_07 (installed manually)
Hope this helps someone...