jaredsburrows / gradle-license-plugin

Gradle plugin that provides a task to generate a HTML license report of your project.
https://central.sonatype.com/artifact/com.jaredsburrows/gradle-license-plugin
Apache License 2.0
401 stars 65 forks source link

ignoredGroups matches artifact substrings #397

Open shashachu opened 7 months ago

shashachu commented 7 months ago

Not sure if this is intended or a bug.

If my app has artifacts: foo:bar:baz foo:bar:baz-qux

and I configure the following exclusion:

licenseReport {
    ignoredPatterns = ["foo:bar:baz"]
}

then foo:bar:baz-qux will be omitted from the output.

My first thought is that if an ignoredPattern has a full artifact name, we should take that as an exact match pattern vs a substring, but this could break existing users if they're depending on that behavior, and also possibly break the version matching. We could also introduce some fancy wildcard or regex support.

cc @mudkiplex since they authored the PR

mudkiplex commented 6 months ago

It was intended in the sense that I did not consider the use case you are describing. I didn't reckon anyone would want to include a sub artifact (which I assume foo:bar:bas-qux is) among the licenses, but not the main artifact (foo:bar:bas), while still depending on both in the project.

Then again, "ignoredPatterns" should perhaps refer to complete regex pattern matches, not just a contains check, as it's currently implemented. This would be a breaking change though, as you point out.