feat: support parsing pom.xml / maven / java #81
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.
While I've done a bit of Java (mainly from my uni days), I've never done a lot with the ecosystem so didn't know much about how dependencies were actually managed other than them coming from Maven, and so I didn't really realise that Java / Maven doesn't actually have a lockfile.
This results in the all the standard caveats of not having a lockfile: there's no way of knowing the actual exact versions of libraries being used, so it's not possible to give a completely accurate report on what known vulnerabilities impact a project.
This doesn't mean this parser is useless, just that it's going to be the worst for "casual use" (e.g. "just scan my project") as for best results developers are going to have to craft a detailed
pom.xml
that specifies all their dependencies in as exact versions as possible.I imagine it would be somewhat straightforward to write a script that builds this based on the output of
mvn dependency:tree
, and users of plugins like https://github.com/vandmo/dependency-lock-maven-plugin should be fine so long as they're using thepom.xml
output format.Having this parser also means the ecosystem is known now, so the detector will be able to support it once #13 is landed.
Resolves #33