I think in Maven2 there is no way to achieve this, because this is what POM inheritance is for
. However there is one trick that I can think of:
Assume you have the right to upload artifact to your internal artifact repository. You may create an empty JAR, deploy it as log4j:log4j, with a obviously abnormal version (e.g. log4j:log4j:9999 ). Add such dependency in your project-child. Then it will override the dependency of parent to depends on a in-fact-empty JAR.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…