-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
420848 - maven-compiler-plugin source/target 1.8 not recognized
The jdt component of m2e v1.4 does not import java 1.8 projects correctly into eclipse. Instead of setting the compiler compliance level to java 1.8, java 1.4 is used. This patch fixes this issue by adding JavaSE-1.8 to the list of known java runtime environments and adding java 1.8 (respectively java 8) to the list of known source/target compliance levels. This contribution complies with http://www.eclipse.org/legal/CoO.php Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=420848 Signed-off-by: Daniel Dietrich <daniel.dietrich@gmx.net>
- Loading branch information
1 parent
986cb6d
commit 84d401b
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.m2e.test</groupId> | ||
<artifactId>m2e-test-parent</artifactId> | ||
<version>1.0.0</version> | ||
</parent> | ||
|
||
<groupId>org.eclipse.m2e.projects</groupId> | ||
<artifactId>compilerSettings18</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
<description>test project for bug 420848</description> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
23 changes: 23 additions & 0 deletions
23
org.eclipse.m2e.tests/src/org/eclipse/m2e/tests/project/CompilerSettings18Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
package org.eclipse.m2e.tests.project; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.jdt.core.IJavaProject; | ||
import org.eclipse.jdt.core.JavaCore; | ||
|
||
import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase; | ||
|
||
|
||
public class CompilerSettings18Test extends AbstractMavenProjectTestCase { | ||
|
||
public void testCompilerSettings18() throws Exception { | ||
IProject project = importProject("projects/compilerSettings18/pom.xml"); | ||
assertNoErrors(project); | ||
waitForJobsToComplete(); | ||
|
||
IJavaProject javaProject = JavaCore.create(project); | ||
assertEquals("1.8", javaProject.getOption(JavaCore.COMPILER_SOURCE, true)); | ||
assertEquals("1.8", javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true)); | ||
} | ||
|
||
} |