Artifacts from dependencies can be excluded by declaring an element inside a But in this case it\'s needed to
When you call a package but do not want some of its dependencies you can do a thing like this (in this case I did not want the old log4j to be added because I needed to use the newer one):
package
package-pk
${package-pk.version}
org.apache.logging.log4j
log4j-core
org.apache.logging.log4j
log4j-api
org.apache.logging.log4j
log4j-core
2.5
org.apache.logging.log4j
log4j-api
2.5
This works for me... but I am pretty new to java/maven so it is maybe not optimum.