slachiewicz opened a new pull request, #72: URL: https://github.com/apache/maven-jdeps-plugin/pull/72
## Description This PR adds support for finding the `jdeps` executable in the system PATH when JAVA_HOME is not set, making the plugin more flexible and easier to use in various environments. ## Changes - 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 (`path-fallback`) to verify PATH fallback functionality works correctly ## Motivation Previously, the plugin would fail with an error if JAVA_HOME was not set, even when `jdeps` was available in the system PATH. This is a common scenario in: - CI/CD environments where tools are available in PATH but JAVA_HOME may not be configured - Developer workstations with system-wide JDK installations - Container environments where binaries are in standard PATH locations ## Resolution Order The plugin now searches for jdeps in the following order: 1. Maven Toolchain (if configured) 2. System's Java home directory 3. JAVA_HOME environment variable (if set) 4. System PATH environment variable 5. Error if not found in any location ## Testing - All existing unit tests pass - New integration test validates PATH fallback scenario - Manual testing confirms the plugin works when JAVA_HOME is unset but jdeps is in PATH ## Compatibility This change is backwards compatible - existing configurations will continue to work as before. The change only adds an additional fallback mechanism. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
