java - Updating the pom.xml with Eclipse -
using eclipse m2eclipse plug-in, how update pom.xml, “maven->update project” won’t reset project configuration java 1.5? using eclipse kepler 4.3, java 7, , m2eclipse plug-in. create new maven project “create simple project (skip archetype selection)” checked , artifactid “test”. following warning.
description resource path location type build path specifies execution environment j2se-1.5. there no jres installed in workspace strictly compatible environment. test build path jre system library problem
i use following steps change compiler 1.5 1.7. 1. on project, right-click “properties” , select “java build path”. 2. go “libraries” tab. 3. remove old jre system library [javase-1.5]. 4. click “add library…”, select “jre system library”, , click “next>”. 5. check “execution environment” radio button , select “javase 1.7 …” adjoining menu. 6. click “finish” 7. click “ok”.
the warning disappears.
i right-click project , select “maven->update project”. click “ok”.
the warning message returns.
my understanding plugin uses pom.xml update eclipse’s current settings. how update pom.xml, “maven->update project” won’t reset project configuration java 1.5?
i looked @ these pages, think answers obsolete. warning - build path specifies execution environment j2se-1.4 what causes new maven project in eclipse use java 1.5 instead of java 1.6 default , how can ensure doesn't? maven not compile in java 1.6
for example, adding …
<configuration> <source>1.7</source> <target>1.7</target> </configuration>
… after version section in pom doesn’t fix problem.
you need use maven compiler plugin.
<build> <plugins> <!-- tell maven compile using java 1.7 --> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.0</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build>
Comments
Post a Comment