Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] m2e creates invalid Eclipse compiler project settings

Dear m2e community,
 
I’m having installed:
  • Eclipse Juno Service Release 2
  • m2e plugin version 1.3.1.20130219-1424
 
with the following Maven „pom.xml“:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<!-- used by "m2e" Eclipse plugin to update the
     "Source compatibility level" and "Compiler compliance
            level" within the Eclipse project "Java compiler"
            settings when running "Maven" -> "Update project". -->
<source>1.6</source>
       <!-- used by "m2e" Eclipse plugin to update the
            "Generated .class files compatibility" within the
            Eclipse project "Java compiler"
            settings when running "Maven" -> "Update project".
            It also changes the "JRE System Library" version within
            the "Java Build Path" Eclipse project settings. -->
<target>1.7</target>
       <compilerArgument>-Xlint:all</compilerArgument>
       <showWarnings>true</showWarnings>
       <showDeprecation>true</showDeprecation>
</configuration>
 
The problem:
  • when updating the Eclipse project configuration using m2e based on the “pom.xml” (Maven -> Update project -> Update project configuration from pom.xml), I get an invalid Eclipse “Java compiler” configuration setting for this project, as Eclipse tells me “Classfile compatibility must be equal or less than compliance level”
 
The root cause:
  • the “maven-compiler-plugin” setting for <target> is not used to set the “Compiler compliance level”. So, it differs compared to the setting “Generated .class files compatibility”.
  • m2e does ignore a potential available setting “<compilerVersion>1.7</compilerVersion>”
 
Is it a real bug or is there a solution available?
 
Best regards,
Holger King
 
 

Back to the top