Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2017-08-30 16:13:58 -0400
committerFred Bricon2017-08-30 16:50:19 -0400
commita74cf0c80f20d2b0207eae8f0fb78550cd6dfa04 (patch)
treef93d195faee187befdb94242e33e755dee547ac6 /org.eclipse.m2e.jdt
parent00c263580f0f76db6ca56e0efd6da702e539775f (diff)
downloadm2e-core-a74cf0c80f20d2b0207eae8f0fb78550cd6dfa04.tar.gz
m2e-core-a74cf0c80f20d2b0207eae8f0fb78550cd6dfa04.tar.xz
m2e-core-a74cf0c80f20d2b0207eae8f0fb78550cd6dfa04.zip
521637 : use inherited Java settings when converting a project
also bumped m-c-p version to 3.6.2 Change-Id: I5574814f6cf12cd82bebc6e8a8637f9cfc4ea8df 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/JavaProjectConversionParticipant.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConversionParticipant.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConversionParticipant.java
index 934731f7..688afb4e 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConversionParticipant.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConversionParticipant.java
@@ -80,7 +80,7 @@ public class JavaProjectConversionParticipant extends AbstractProjectConversionP
private static final String COMPILER_ARTIFACT_ID = "maven-compiler-plugin"; //$NON-NLS-1$
- private static final String DEFAULT_COMPILER_VERSION = "3.6.1"; //$NON-NLS-1$
+ private static final String DEFAULT_COMPILER_VERSION = "3.6.2"; //$NON-NLS-1$
private static final String TARGET_KEY = "target"; //$NON-NLS-1$
@@ -107,8 +107,8 @@ public class JavaProjectConversionParticipant extends AbstractProjectConversionP
configureBuildSourceDirectories(model, javaProject);
//Read existing Eclipse compiler settings
- String source = javaProject.getOption(JavaCore.COMPILER_SOURCE, false);
- String target = javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, false);
+ String source = javaProject.getOption(JavaCore.COMPILER_SOURCE, true);
+ String target = javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true);
//We want to keep pom.xml configuration to a minimum so we rely on convention. If the java version == 1.5,
//we shouldn't need to add anything as recent maven-compiler-plugin versions target Java 1.5 by default
@@ -137,6 +137,17 @@ public class JavaProjectConversionParticipant extends AbstractProjectConversionP
}
private void configureCompilerPlugin(Model model, String source, String target) {
+ boolean emptySource = source == null || source.isEmpty();
+ boolean emptyTarget = target == null || target.isEmpty();
+
+ if(emptySource && emptyTarget) {
+ return;
+ }
+ if(emptySource) {
+ source = target;
+ } else if(emptyTarget) {
+ target = source;
+ }
Build build = getOrCreateBuild(model);
model.setBuild(build);

Back to the top