- 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) ...
- CloudBees Jenkins Enterprise
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.
DEV@cloud specificity: The minimum Java version supported is Java 8. By default you can find on your instance configuration a default Apache Maven installation called “Maven (latest)”. This one is available for testing purposes only and can be upgraded at any time. It is recommended to not use them for “production”. You should install your own version that you’ll control over the time to ensure the reproducibility and stability of your build.