aviad cohen
aviad cohen

Reputation: 667

maven shade plugin doesn't let me consume the reduced-dependencies.pom

After creating a jar with shade plugin, where I shaded a certain dependency, the reduced-dependencies.pom is generated and I would like to consume it in a different project.

I can't understand how this can be done, as ONLY the complete original pom gets to be installed (and later on deployed) to my .m2 repo. I have read and could not find my answer here, here (where OrangeDog asked it inside the comments and wasn't answered) and here.

How can I use the reduced-pom instead of the original pom in a different project ???

Upvotes: 2

Views: 342

Answers (1)

aviad cohen
aviad cohen

Reputation: 667

After some farther testing it seemed that the problem was found: if you use the <shadedArtifactAttached>true</shadedArtifactAttached> option in the shade plugin configuration then the shaded artifact is added near the original (non-shaded) artifact, and the original (non-shaded) artifact is the one that is being installed to .m2 along with the (non-shaded) pom.

In case not using this configuration (which is by default false), then the shade plugin behaves as expected: there is only one artifact - the shade artifact - and it, along with its reduced-dependencies.pom gets to be uploaded to .m2, as expected.

Upvotes: 1

Related Questions