Posts

Showing posts from October, 2016

Maven Dependancy Exclusion

Consider the case where you are using the Log4J2 however the dependency you are trying to add for CXF or something brings in log4j1.x. You are missing a bunch of new functionality because logger still refers to old version. Obvious  you need to remove the Transitive dependency but how to identify the transitive dependencies mvn dependency:tree -Dverbose -Dincludes=log4j:log4j [groupId]:[artifactId]:[type]:[version] http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html will show you the dependency-tree, but only the relevant excerpt. Using this information you can now add your exclusions to the affected pom.xml files Eg: <!-- CXF Dependancies --> < dependency > < groupId > org.apache.cxf </ groupId > < artifactId > cxf-java2wadl-plugin </ artifactId > < version > ${cxf-version} </ version > < exclusions > < exclusion >