Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2013-11-04 18:21:20 -0500
committerFred Bricon2014-03-28 14:58:02 -0400
commit0ca77b68effd3f3b86e68ca5ab3c3e15236085e9 (patch)
tree86da828bcd1223e45e9f08165f05940586178e93
parent6893c12fea09321421f2c4b143d4ec262c80a31c (diff)
downloadm2e-core-m2e-1.4.x.tar.gz
m2e-core-m2e-1.4.x.tar.xz
m2e-core-m2e-1.4.x.zip
420848 - maven-compiler-plugin source/target 1.8 not recognizedreleases/1.4/1.4.1.20140328-1905m2e-1.4.x
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 Original Author : Daniel Dietrich <daniel.dietrich@gmx.net> Change-Id: I31be52a109376722d0cc0d5dcd244e625beb6784 Signed-off-by: Daniel Dietrich <daniel.dietrich@gmx.net>
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
index d936dc4d..6fea0b9c 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
@@ -72,9 +72,10 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
public static final String COMPILER_PLUGIN_GROUP_ID = "org.apache.maven.plugins";
- protected static final List<String> SOURCES = Arrays.asList("1.1,1.2,1.3,1.4,1.5,5,1.6,6,1.7,7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
+ protected static final List<String> SOURCES = Arrays.asList("1.1,1.2,1.3,1.4,1.5,5,1.6,6,1.7,7,1.8,8".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
- protected static final List<String> TARGETS = Arrays.asList("1.1,1.2,1.3,1.4,jsr14,1.5,5,1.6,6,1.7,7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
+ protected static final List<String> TARGETS = Arrays
+ .asList("1.1,1.2,1.3,1.4,jsr14,1.5,5,1.6,6,1.7,7,1.8,8".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
private static final String GOAL_RESOURCES = "resources";
@@ -95,6 +96,7 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
ENVIRONMENTS.put("jsr14", "J2SE-1.5"); //$NON-NLS-1$ //$NON-NLS-2$
ENVIRONMENTS.put("1.6", "JavaSE-1.6"); //$NON-NLS-1$ //$NON-NLS-2$
ENVIRONMENTS.put("1.7", "JavaSE-1.7"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.8", "JavaSE-1.8"); //$NON-NLS-1$ //$NON-NLS-2$
}
protected static final String DEFAULT_COMPILER_LEVEL = "1.4"; //$NON-NLS-1$
@@ -469,6 +471,8 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
source = "1.6";
} else if(source.equals("7")) {
source = "1.7";
+ } else if(source.equals("8")) {
+ source = "1.8";
}
// While "5" and "6" are valid synonyms for Java 5 and Java 6 target,
@@ -479,6 +483,8 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
target = "1.6";
} else if(target.equals("7")) {
target = "1.7";
+ } else if(target.equals("8")) {
+ target = "1.8";
}
options.put(JavaCore.COMPILER_SOURCE, source);

Back to the top