Another use case is where you define a parent pom using the maven-eclipse-plugin enabling WTP capabilities by default:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
Then in a child pom of a project you want to disable the WTP because you are using m2eclipse. If you do not disable/exclude the maven-eclipse-plugin you get a nasty error message in eclipse:
"An internal error occurred during: "Importing Maven projects".
loader constraint violation: when resolving method
"org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Lorg/codehaus/plexus/util/xml/XMLWriter;Lorg/codehaus/plexus/util/xml/Xpp3Dom;)V"
the class loader (instance of
org/codehaus/plexus/classworlds/realm/ClassRealm) of the current
class, org/apache/maven/plugin/eclipse/writers/wtp/EclipseWtpApplicationXMLWriter,
and the class loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved
class, org/codehaus/plexus/util/xml/Xpp3DomWriter, have different
Class objects for the type org/codehaus/plexus/util/xml/XMLWriter used
in the signature"
Let me add a few words of my own.
Jetty's POM file declares "slf4j-simple" as a dependency. However,
some users of Jetty would like to override this dependency, for
example with "slf4j-log4j12".
Is this possible with Maven?