Reproduces Eclipse‘s compiler warnings for a module without a running Eclipse, by compiling its sources with the ecj compiler under the module’s own preferences.
python3 scripts/eclipse-warnings.py juneau-rest/juneau-rest-server python3 scripts/eclipse-warnings.py --all
Run from the repository root.
| Option | Argument | Default | Meaning |
|---|---|---|---|
module-path | path (positional) | none | Module directory relative to the repository root. Exactly one argument is required. |
--all | none | off | Check every module that apply-eclipse-prefs.py would update, source and test modules. Used in place of module-path. |
main).ecj 3.45.0 jar, ~/.m2/repository/org/eclipse/jdt/ecj/3.45.0/ecj-3.45.0.jar unless ECJ_JAR is set, and exits 2 if it is missing (find_ecj_jar).--all, loads apply-eclipse-prefs.py and uses its module discovery (load_apply_prefs_module).mvn -q dependency:build-classpath from inside the module directory to get its runtime and test classpath (build_classpath, 180 second limit)..settings/org.eclipse.jdt.core.prefs or no Java sources (run_ecj).java -jar ecj.jar -properties <module prefs> -enableJavadoc -warn:+allJavadoc,invalidJavadoc,javadoc -cp <classpath> -d <temp dir> <sources> over src/main/java and src/test/java (300 second limit), with the module's target/classes and target/test-classes appended to the classpath.n problems (e errors, w warnings) line (summarize).A banner per module, ecj's raw diagnostics, and a >>> <module>: <summary> line.
| Code | Meaning |
|---|---|
| 0 | No module reported problems. |
| 1 | A usage error, or at least one module's summary was not 0 errors, 0 warnings. |
| 2 | The ecj jar was not found. |
ECJ_JAR overrides the jar location. JAVA_HOME is preferred over the first java on the PATH.~/.m2 for other reactor modules, not their current sources. A type that is new or renamed in an upstream module shows as “cannot be resolved” until that module is installed again.mvn and java on the PATH. A slow module can hit the time limits and raise an uncaught timeout.apply-eclipse-prefs.py