1

I have this situation:

In my maven pom of my project A, I have a dependency B which is packaged into a shaded jar. My project A is packaged to war.

When I run mvn install it is building my war for project A and in my WEB-INF/lib I have my shaded jar of project B.

What I want to do is to exclude a specific transitive dependency C from project B when building my war. I tried using <exclusions> to exclude the dependency C when declaring the dependency for project B but at the war packaging I still get the dependency C in the shaded jar of B.

The thing is I do not want to modify my pom of project B. I want the exclusion to be done in my war pom if possible.

Is there a way to do this ?

razafinr
  • 932
  • 2
  • 10
  • 15
  • 1
    Is there a way to replace B with a version that isn't shaded? Because AFAIK such a dependency is for maven just a single jar without transitive dependencies i.e. nothing to exclude. Otherwise you may have to go a route like http://stackoverflow.com/questions/2830837/remove-file-from-dependency-jar-using-maven – zapl Sep 04 '15 at 22:27
  • Thanks , I think I am gonna go for unshaded version. – razafinr Sep 05 '15 at 10:01

0 Answers0