This repository was archived by the owner on Jan 9, 2024. It is now read-only.
fix: handle long classpaths #38
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does
This change set updates the maven wrapper to use only plugins for determining the classpath we pass to the call graph builder. It uses
dependency:build-classpath
to get the classpath for the dependencies. Sadly, that doesn't include the output directory (I tried to set the scope tocompile
, but I couldn't get it to add the output directory to the classpath it gives back). To work around this, it useshelp:evaluate
to getproject.build.outputDirectory
, and append it to the classpath manually.This has a few advantages:
and a few shortcomings:
maven-help
, but that seems to be available without having to add it to the POM file.It's been tested on macOS and Windows, and it gives the same results as the current approach.
For context: https://snyk.slack.com/archives/C07N668DA/p1605690001356600
Notes for the reviewer
I've opted to keep the current method as a fallback. We'll remove it when we can confirm this works in the wild.
More information