diff --git a/CHANGELOG.md b/CHANGELOG.md index 33d7b702..9d9c875b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Change +- configure ecj to use .settings/org.eclipse.jdt.core.prefs when present + + ## [6.0.0] - 2024-09-10 ### Fix diff --git a/pom.xml b/pom.xml index bc40818d..f74f9475 100644 --- a/pom.xml +++ b/pom.xml @@ -283,6 +283,7 @@ setProjectProp("maven.javadoc.skip", "true"); } + /* * loading/locating eclipse Java compiler artifact */ @@ -298,6 +299,16 @@ setProjectProp("custom.ecjJarPath", ecjArtifact.file.absolutePath); + /* + * check if .settings/org.eclipse.jdt.core.prefs is present + */ + jdtCorePrefsFile = new File(project.basedir, ".settings/org.eclipse.jdt.core.prefs"); + if(jdtCorePrefsFile.exists()) { + setProjectProp("custom.ecjProperties", "-properties \"" + jdtCorePrefsFile + "\""); + } else { + setProjectProp("custom.ecjProperties", "-g"); /* using -g just as placeholder to prevent "Unrecognized option : ''"*/ + } + /* * determine bootclasspath for compilation of src/main/java */ @@ -347,7 +358,6 @@ } else { setProjectProp("custom.noJavaTests", "true"); } - } else /* if(!isJavaCompilable)*/ { setProjectProp("custom.noJavaTests", "true"); setProjectProp("maven.javadoc.skip", "true"); @@ -923,6 +933,7 @@ ${custom.compileBootClasspathOption} "${custom.compileBootClasspath}" -encoding ${project.build.sourceEncoding} -g + ${custom.ecjProperties} -parameters + ${custom.ecjProperties} -parameters -genericsignature -maxProblems 10