How do I tell maven that the artifact has been renamed?

Consider the following scenario.

I have a Java 1.8 project that depends on a java 8 foo-barartifact called and a java 5 artifact called baz-qux. baz-quxalso depends on foo-bar. But it uses a special folded java 5 construct called foo-bar-java5. Thus, by incorporating baz-quxinto my project, I transitively bring foo-bar-java5. As a result, I have an undesirable state when I now have foo-barand foo-bar-java5. There seems to be no way to make a global exception. Therefore, I cannot just rule out foo-bar-java5. Instead, I have to clutter up my clutter and rule it out everywhere when it gets pulled in transitively.

With that said, is there a way to indicate what it foo-barprovides foo-bar-java5? Or is this the only way to truly rule out foo-bar-java5everywhere?

+4
source share
1 answer

Here is the answer from another question that might work for you:

fooobar.com/questions/1585796 / ...

Basically, explicitly specify foo-bar-java5 as a dependency in your project and list it as provided. This will show maven not to archive this jar at build time. It should be much less random than excluding it everywhere.

+1
source

All Articles