Maven dependency exclusion doesn't seem to work

前端 未结 2 864
遥遥无期
遥遥无期 2021-01-18 01:06

I have a Maven project depending on couple other Maven projects. I am using Spring 3.1.1 in my project and dependent projects have 3.0.6. I am trying to exclude Spring 3.0.6

相关标签:
2条回答
  • 2021-01-18 01:14

    Your dependency type is war so there is no resolution happening here. Maven overlays the war contents over your project.

    When the war is published to repository, the artifact will contain dependent libraries in WEB-INF lib folder. During overlay it does not treat lib folder any different from any static resource unless you tell it to exclude in different way.Check 'overlay' property here

    0 讨论(0)
  • 2021-01-18 01:26

    In my case I thought I excluded the right dependency. With eclipse, on dependency hierarchy tab you can right click on it and click exclude artifact and it excluded the right dependency (they both had the same artifactId but different groupId)

    0 讨论(0)
提交回复
热议问题