Maven 1.1 ignores maven.compile.target=1.5 with a 1.6 JDK ---------------------------------------------------------
Key: MPJAVA-47 URL: http://jira.codehaus.org/browse/MPJAVA-47 Project: Maven 1.x Java Plugin Issue Type: Bug Affects Versions: 1.6.1 Environment: Debian Stable x86 Java 1.6.0_02-b05 and Java 1.5.0_10-b03 Reporter: Matt Ray Priority: Minor I recently attempted upgrading from 1.0.2 to 1.1 and had been using JDK 1.6 on the project for several months. I have been using source compiled with Maven 1.0.2 and JDK 1.6 with the properties maven.compile.source=1.5 maven.compile.target=1.5 in my project.properties and the deployment environment has been using the 1.5 JDK. There have been no issues with this previous configuration. I switched in Maven 1.1 and with a few minor fixes, was able to compile and deploy everything. But now when my appserver (JBoss 4.0.4) starts up, I get this exception: ava.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) ... If I change back to a 1.5 JDK for compiling, the issue goes away. Running my build with "-X" shows '-target' '1.5' '-g:lines,vars,source' '-source' '1.5' but something appears to be getting through with Maven 1.1 that didn't get through with 1.0.2. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira