Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2014-05-23 19:43:07 -0400
committerIgor Fedorenko2014-05-26 11:32:50 -0400
commit0f55826d0e48c36db8d00adf098f730e279104aa (patch)
tree3bd7da81e5978d9653a513fec87cad2a4f36fd9a
parentc4c5f41bdd69856cd8f1179ac6e69d8dd57457ea (diff)
downloadm2e-core-0f55826d0e48c36db8d00adf098f730e279104aa.tar.gz
m2e-core-0f55826d0e48c36db8d00adf098f730e279104aa.tar.xz
m2e-core-0f55826d0e48c36db8d00adf098f730e279104aa.zip
435803 allow extensions provide custom default java source/target levels
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java14
1 files changed, 11 insertions, 3 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 6fea0b9c..a1d94328 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
@@ -454,12 +454,12 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
}
if(source == null) {
- source = DEFAULT_COMPILER_LEVEL;
+ source = getDefaultSourceLevel();
log.warn("Could not determine source level, using default " + source);
}
if(target == null) {
- target = DEFAULT_COMPILER_LEVEL;
+ target = getDefaultTargetLevel(source);
log.warn("Could not determine target level, using default " + target);
}
@@ -498,6 +498,14 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
}
}
+ protected String getDefaultTargetLevel(String source) {
+ return DEFAULT_COMPILER_LEVEL;
+ }
+
+ protected String getDefaultSourceLevel() {
+ return DEFAULT_COMPILER_LEVEL;
+ }
+
protected List<MojoExecution> getCompilerMojoExecutions(ProjectConfigurationRequest request, IProgressMonitor monitor)
throws CoreException {
return request.getMavenProjectFacade().getMojoExecutions(COMPILER_PLUGIN_GROUP_ID, COMPILER_PLUGIN_ARTIFACT_ID,
@@ -521,7 +529,7 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
}
if(levelIdx < 0) {
- return DEFAULT_COMPILER_LEVEL;
+ return null;
}
return levels.get(levelIdx);

Back to the top