Here is my situation:
- I created a new artifact in a library called ‘web-ng-framework’, and moved code into it from an old artifact in the library, ‘web’
- I deleted the ‘web’ artifact
And here is the problem:
- ProjectA uses an older version of the library, and so it has a compile dependency on ‘web’
- ProjectB depends on ProjectA
- ProjectB uses the latest version of the library, so when ProjectB is built, it contains both the ‘web’ and ‘web-ng-framework’ libraries, causing a possible conflict
Does anyone know how I can solve this? Thanks!
EDIT:
Would doing ‘relocation’ of ‘web’ to ‘web-ng-framework’ maybe work better? In ProjectA, I could include a dependency on ‘web’ so that Maven would see that what it really needs is ‘web-ng-framework’. Would that work?
A classic solution to this problem is the ‘Version 99’ hack.
To do this, use the following in your root pom:
Then put an empty web-99.0-does-not-exist.pom and web-99.0-does-not-exist.jar in your repository.
This ensures that every project that inherits from this root pom will not get the old version of the web.jar anymore.