-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added advanced data formatting and sorting #622
base: master
Are you sure you want to change the base?
Added advanced data formatting and sorting #622
Conversation
…eOffice ODS export
…bled extended-info
But also some for the license-summary XML report and Calc
…ng lists were null
And some small code cleanups
b1680ba
to
5e2a345
Compare
Fix to make the sorting tests to be independent of the JDK versions Commented test creation data out again
5e2a345
to
a6ea86a
Compare
@slawekjaranowski I would've donated, like a "beer", to you, but w/o a credit-card I found no way. You could add a Patreon account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only used in readme ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First: Sorry for the delay, I hope I got now much more time to get this PR ready.
The script is there to make the XML files easily readable, otherwise it's not obvious how the XSLT could be used to get a clear view of the sorting in the template XML files.
I needed some time to find it out, and found it also hard to read the raw XML files, to check if the generated XML files were actually correct. I don't want to test against incorrect data.
Here is an example for the Plugin-ID sorting, when transformed by the XSLT and hosted by the python mini-webserver:
If xsltproc
is installed, it's used to generate HTML websites, where the JavaScript works, so a quick Column sorting can be done. It's also an alternative if the python mini-webserver doesn't work.
And every time the sorting gets updated, new test-files to check against must be generated. So, this makes it much easier to make that correct.
} | ||
|
||
// -------------- Sort by name ------------------- | ||
static void checkResultingLicensesXml(Logger log, File basedir, String expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why so such complicated method ....
why not use groovy xmlslurper
- https://groovy-lang.org/processing-xml.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that is an interesting solution, the code is now much more compact. I pushed that.
Although: I researched the topic and found out that for my task I should use the "XML Parser", since I need to read always the whole XML document anyway.
a6ea86a
to
384c67a
Compare
Hi, I made a bigger update because I was missing some clarity and readability in the license reports. With big projects and an enormous amount of (transitive) dependencies I got lost, so I added these settings.
Feel free to comment on whatever changes you need, to accept this pull-request.
The essential changes are:
DataFormatting
option toAbstractDownloadLicensesMojo
to format the data. The specific settings are:orderBy
, to order / sort the output by 4 possible values:I marked the option
sortByGroupIdAndArtifactId
inAbstractDownloadLicensesMojo
therefore as deprecated.problematicLicenses
, to list problematic licenses, which get highlighted in a special color in the XML or ODS report. As also a different sort order when usingorderBy
License-MatchokLicenses
, to list licenses which are explicitly allowed. They get highlighted in a special color in the XML or ODS report. As also a different sort order when usingorderBy
License-MatchexcludedLicenses
.matchedLicensesHaveBorder
. If licenses found inexcludedLicenses
,problematicLicenses
,okLicenses
or wherehighlightUnknownLicenses
is used, have a visible border. The border makes license types better visible at a glance, but when quickly scrolling through a long list, it makes licenses look as if they were the only ones belonging to a dependency if it has multiple licenses.highlightUnknownLicenses
. If all unknown licenses should be highlighted. Unknown means: There is no entry for a license inexcludedLicenses
,problematicLicenses
,okLicenses
.skipDevelopers
just skip the mentioning of developers in the license reports. They are most likely irrelevant for the license report, but are the main reason one dependency entry can get far to many lines. Which makes the report just much harder to read and grasp.aggregate-download-licenses-sort-by-dependencyName
,aggregate-download-licenses-sort-by-licenseMatch
,aggregate-download-licenses-sort-by-licenseName
andaggregate-download-licenses-sort-by-pluginId
.Example
pom.xml
:LicenseDownloader
now sends a User-Agent, so license downloads fromgnu.org
can become possible. Otherwise it sends an irritating and misleading error: "429 Too many requests". And "gnu.org" is an extremely often used license hoster.AbstractAddThirdPartyMojo
sincludedLicenses
andexcludedLicenses
, by adding it toStringToList
. So you can not only write (the old way):<includedLicenses>licenseA|licenseB</includedLicenses>
, but also:AbstractDownloadLicensesMojo
slicenseMerges
all mainly used license-name variations. This is always a huge waste of time, if you set up a new project from scratch and need to find out again all standard name-variations of licenses. I don't want to add that as a default, since I consider that to be maybe too much "magic", and it should be very transparent and intentionally decided which license names mean really the same. So this works as an extremely convenient time-saving suggestion.