Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2017-03-29 15:50:39 -0400
committerFred Bricon2017-03-29 16:42:47 -0400
commit52e933c84c1f884e3c68d50d3945232d696877b9 (patch)
tree578f31c6c543808f4d8c835ba1df906e292ce378 /org.eclipse.m2e.jdt
parent80d9edfa3f007f665218a8a4a4eb1627d88b8426 (diff)
downloadm2e-core-52e933c84c1f884e3c68d50d3945232d696877b9.tar.gz
m2e-core-52e933c84c1f884e3c68d50d3945232d696877b9.tar.xz
m2e-core-52e933c84c1f884e3c68d50d3945232d696877b9.zip
471362 add support for maven-compiler-plugin:3.6 release flag
Signed-off-by: Fred Bricon <fbricon@gmail.com>
Diffstat (limited to 'org.eclipse.m2e.jdt')
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java27
1 files changed, 20 insertions, 7 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 c43bd0f1..59f2a496 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
@@ -75,6 +75,8 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
public static final String COMPILER_PLUGIN_GROUP_ID = "org.apache.maven.plugins";
+ protected static final List<String> RELEASES = Arrays.asList("6,7,8,9".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,1.9,9".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -513,19 +515,30 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
IProgressMonitor monitor) throws CoreException {
String source = null, target = null;
+ //New release flag in JDK 9. See http://mail.openjdk.java.net/pipermail/jdk9-dev/2015-July/002414.html
+ String release = null;
+
for(MojoExecution execution : getCompilerMojoExecutions(request, monitor)) {
+ release = getCompilerLevel(request.getMavenProject(), execution, "release", source, RELEASES, monitor);
+ //XXX ignoring testRelease option, since JDT doesn't support main/test classpath separation - yet
source = getCompilerLevel(request.getMavenProject(), execution, "source", source, SOURCES, monitor); //$NON-NLS-1$
target = getCompilerLevel(request.getMavenProject(), execution, "target", target, TARGETS, monitor); //$NON-NLS-1$
}
- if(source == null) {
- source = getDefaultSourceLevel();
- log.warn("Could not determine source level, using default " + source);
- }
+ if(release != null) {
+ source = release;
+ target = release;
+ } else {
+ if(source == null) {
+ source = getDefaultSourceLevel();
+ log.warn("Could not determine source level, using default " + source);
+ }
+
+ if(target == null) {
+ target = getDefaultTargetLevel(source);
+ log.warn("Could not determine target level, using default " + target);
+ }
- if(target == null) {
- target = getDefaultTargetLevel(source);
- log.warn("Could not determine target level, using default " + target);
}
// While "5" and "6" ... are valid synonyms for Java 5, Java 6 ... source,

Back to the top