NullPointerException after mvn eclipse:eclipse


Today I came across a strange error when generating eclipse metadata using maven.

Running “mvn eclipse:eclipse” results in :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse (default-cli) on project mxGWTUtils: Execution default-cli of goal org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse failed. NullPointerException -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse (default-cli) on project


Caused by: java.lang.NullPointerException

at org.apache.maven.artifact.versioning.ComparableVersion.parseVersion(

at org.apache.maven.artifact.versioning.ComparableVersion.<init>(

at org.apache.maven.artifact.versioning.DefaultArtifactVersion.parseVersion(

at org.apache.maven.artifact.versioning.DefaultArtifactVersion.<init>(

at org.apache.maven.artifact.DefaultArtifact.compareTo(

at org.apache.maven.artifact.DefaultArtifact.compareTo(


at java.util.TreeMap.put(

at java.util.TreeSet.add(

at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.getProjectArtifacts(

at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.doDependencyResolution(

at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(


After a while, I have found out that this error is caused by using Maven version ranges (e.g. “[0.2.0,)” meaning any version larger than 0.2.0) rather than exact version numbers.

So, for instance a dependency like the following will cause the NullPointerException:






Whereas the following specification of the dependency will cause the NullPointerException to disappear:







In my case, this problem was caused by upgrading from Java 1.6 22 to Java 1.7.

Therefore, downloading a version of Java 1.6 and specifying its directory as JAVA_HOME solves the problem. A short solution that took me long to find. Who would have suspected this bug is cause by Java?

3 thoughts on “NullPointerException after mvn eclipse:eclipse

Leave a Reply to Max Rohde Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s