sbt-assembly icon indicating copy to clipboard operation
sbt-assembly copied to clipboard

File Name Filtering causing False Positives

Open JAlexoid opened this issue 3 years ago • 3 comments

Filtering contents of UberJar by filename causes false positives.

As an example, if the I were to filter out all fasterxml jars from uber jar I would add a filter for startsWith("jackson"), but that yields false positives. As an example Jackson Databind OpenAPI library.

Without artifact data access this also yields unpredictable results, when upgrades happen.

JAlexoid avatar Feb 01 '22 23:02 JAlexoid

Thanks for the report. Could you provide reproduction steps so we can reproduce your problem on our computers?

eed3si9n avatar Feb 02 '22 14:02 eed3si9n

Please see this repo https://github.com/JAlexoid/sample-sbt-assembly-failure

When you run sbt clean assembly the Uber jar excludes "org.openapitools" % "jackson-databind-nullable" as well. I need to filter out only FasterXML Jackson libraries(all of them), but OpenAPI libraries should be preserved.

The filtering happens on the artifactId, rather than on group and artifact IDs.

This is not detectable until runtime.

JAlexoid avatar Feb 03 '22 18:02 JAlexoid

SBT Assembly needs ability to filter on dependency metadata, not just filename.

JAlexoid avatar Feb 03 '22 18:02 JAlexoid