Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Compiler version weirdness

"Update Project Configuration" did not do anything for me, the project still uses Java 1.4.
Definig the compiler plugin 2.3.2 in pom on the other hand did change the Java version to 1.5.
 
Regards,
David
 
 


From: m2e-users-bounces@xxxxxxxxxxx [mailto:m2e-users-bounces@xxxxxxxxxxx] On Behalf Of Anders Hammar
Sent: Thursday, November 04, 2010 3:00 PM
To: Maven Integration for Eclipse users mailing list
Subject: Re: [m2e-users] Compiler version weirdness

I just tested this and with the staged 0.12.0 version of m2e core, the jre version is set correctly. I tested with a project defining maven-compiler-plugin v2.3.2 and configured with source/target to 1.6.
However, I know from experience that this was an issue with older versions (0.10.0 and most likely 0.10.2) of m2e-core.

As a workaround when this doesn't work automatically upon import or creating a Maven project, forcing a "Update Project Configuration" fixes it.

/Anders

On Wed, Nov 3, 2010 at 22:07, Fred Bricon <fbricon@xxxxxxxxx> wrote:
David,

starting from version 2.3.2, maven-compiler-plugin defaults to source 1.5. This is the version defined by default in maven 3.0 final, previous versions used source = 1.4.

In order for m2eclipse to configure java source compiler to 1.5 by default, you need to either lock the maven-compiler-plugin version in your pom (highly advised) :
...
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
            </plugin>
         ...
       </plugins>
    </build>

or you can pick an m2eclipse-core plugin based on maven 3.0 (0.12.0 has been staged here [1]). However, due to an incompatibility between core 0.12.0 and current m2e-wtp 0.11.0, you'd better wait for a fix in the next few days before upgrading.

[1] https://repository.sonatype.org/content/repositories/forge-sites/m2e/0.12.0/S/0.12.0.20101102-1505/
[2] https://issues.sonatype.org/browse/MNGECLIPSE-2483


regards,

Fred Bricon

2010/11/3 David Balažic <david.balazic@xxxxxxxxxxxx>

Hi!

I use Eclipse Java EE Helios SR-1
and m2eclipse items:
 - feature 0.10.2
 - subclipse.feature 0.10.0
 - scm.feature 0.10.0
 - wtp.feature 0.11.0.20101024-0955

I created a new maven project and noticed that the Eclipse classpath and compiler versions
are set to 1.4.

This page* says:
the default source setting is 1.5 and the default target setting is 1.

So I wonder why does m2eclipse configure 1.4 in the Eclipse project.

* - http://maven.apache.org/plugins/maven-compiler-plugin/


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



--
"Have you tried turning it off and on again" - The IT Crowd

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



Back to the top