Add PATH fallback when JAVA_HOME is unset (#72) * Add PATH fallback when JAVA_HOME is unset - Modified AbstractJDepsMojo.getJDepsExecutable() to search for jdeps in PATH when JAVA_HOME is not set or jdeps is not found in JAVA_HOME - Changed JAVA_HOME from required to optional - Improved error message to inform users about both JAVA_HOME and PATH options - Added integration test to verify PATH fallback functionality works correctly This change allows the plugin to work in environments where JAVA_HOME is not set, as long as jdeps is available in the system PATH, which is common in many development environments and CI/CD systems. Fixes: Support for running jdeps when JAVA_HOME is not configured * Update src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Resolve PR review comments: improve PATH lookup and integration test - Reuse env Properties object to avoid duplicate retrieval - Use canonical paths consistently for both JAVA_HOME and PATH lookups - Add check to skip empty PATH entries - Add canExecute() verification for executable permissions - Improve error message to be more generic - Unset JAVA_HOME in integration test to properly test PATH fallback * Update src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/main/java/org/apache/maven/plugins/jdeps/AbstractJDepsMojo.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
You have found a bug, or you have an idea for a cool new feature? Contributing code is a great way to give something back to the open source community. Before you dig right into the code, there are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
We accept Pull Requests via GitHub. The developer mailing list is the main channel of communication for contributors.
There are some guidelines which will make applying PRs easier for us:
git diff --check before committing.mvn -Prun-its verify to assure nothing else was accidentally broken.If you plan to contribute on a regular basis, please consider filing a contributor license agreement.