maven-dependency-plugin
maven-dependency-plugin copied to clipboard
[MDEP-799] tree: add optional output type json
Following this checklist to help us incorporate your contribution quickly and easily:
- [X] Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
- [x] Each commit in the pull request should have a meaningful subject line and body.
I will squash and update the commit in the end. There is still open discussion.
-
[X] Format the pull request title like
[MDEP-XXX] - Fixes bug in ApproximateQuantiles, where you replaceMDEP-XXXwith the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. -
[x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
-
[X] Run
mvn clean verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically. -
[x] You have run the integration tests successfully (
mvn -Prun-its clean verify). -
[X] I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
-
[X] In any other case, please file an Apache Individual Contributor License Agreement.
I sent the mail for this a few minutes ago so it should be signed soon.
I tried to understand the way you write unit/integration tests but it looks a bit complicated. What is the correct way to add a testcase? Best case, I can add a pom and check if the model written as json -> read by any JSON parser is equal to the model before.
The JSON files currently exist for you to see the current printed format. It will be deleted afterward.
This PR adds JSON output type to the maven-depdenceny-plugin with the goal tree.
Supersedes #207
CLA is now signed and accepted.
As I am a first-time contributor, someone has to approve the workflow run before we see CI results.
@elharo could you approve the worflow run?
@MartinWitt what's left to do to get this through? FWIW, there is a cottage industry of smalls tools and scripts that are parsing this plugin output .... it would be awesome to have a structured JSON output! Anything to help you need move this forward?
Looking at the details of this PR, it feels to me that crafting the JSON by hand as done here feels like problems in the making with encoding or else. Should not this use a proper JSON library of sorts? Is not there one bundled in the standard Maven or Java and this plugin may therefore always have have one on hand?
(Sorry for these likely dumb questions: my Java skills need to brushing off)
If it's useful to anyone, we've developed a Maven dependency tree plugin that generates a JSON dependency tree. Check it out at: https://github.com/jfrog/maven-dep-tree.