A Maven build is failing with ERROR: Failed to parse POMs ... Unsupported major.minor version 51.0

Issue

  • A Maven build is failing with an error like
ERROR: Failed to parse POMs 
...
Caused by: java.lang.UnsupportedClassVersionError: org/apache/maven/eventspy/EventSpy : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
...

Environment

Resolution

Apache Maven 3.3.x requires a minimum of Java 7 and your build is configured to use Java 6.

Either install and configure your job to use a version of Maven < 3.3 or install and configure your job to use a version of JDK > 6 to solve the issue. The Configuration Slicing Plugin will help you to easily change the version of Apache Maven or the JDK used in several jobs in one step.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.