Skip to main content

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

Is there particular reason your project requires 1.6/1.7 source/target
combination?

There is a clear discrepancy between maven-compiler-plugin and eclipse
java project configuration and I don't think there is a way to make m2e
make correct translation in all cases. I am not even sure there is a way
to improve when we already have, but I am open for ideas (and, of
course, quality patches are always welcome).

--
Regards,
Igor

On 2013-03-13 2:10 PM, King Holger (CI/AFP2) wrote:
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 *


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top