Friday, December 7, 2012

What JRE will a new Maven project in Eclipse use by default and how to change it?

m2eclipse ignores what you configure for the Eclipse default. It will always use 1.5 by default. 

So if you want a Maven project to be configured to use Java 1.6 settings when imported under Eclipse, configure the maven-compiler-plugin appropriately:


<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>2.1</version>
  <configuration>
    <source>1.6</source>
    <target>1.6</target>
  </configuration>
</plugin>


No comments:

Post a Comment