Maven 2 & 3
  1. Maven 2 & 3
  2. MNG-2163

Allow plugin dependencies to be excluded

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.2
    • Component/s: Dependencies
    • Labels:
      None
    • Environment:
      Windows XP, Cygwin
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Need to add an exclusions block in the POM for plugins. The use-case is excluding slf4j-simple
      from the jetty6 plugin in order to use an alternative slf4j implementation.

        Issue Links

          Activity

          Hide
          Ceki Gulcu added a comment -

          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?

          Show
          Ceki Gulcu added a comment - 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?
          Hide
          Will Hoover added a comment -

          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"

          Show
          Will Hoover added a comment - 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"
          Hide
          LexeY added a comment -

          I have jetty plugin and need to exclude jaas-1.0.jar from its dependencies.
          Need something like this:
          <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>maven-jetty-plugin</artifactId>
          <version>6.1.10</version>
          <exclusions>
          <exclusion>
          <artifactId>jaas</artifactId>
          <groupId>jaas</groupId>
          </exclusion>
          </exclusions>
          </plugin>

          I use IBM java, and java have this jar too, and i need use this jar only from JDK, not from jetty plugin.
          Now i have conflict.

          Show
          LexeY added a comment - I have jetty plugin and need to exclude jaas-1.0.jar from its dependencies. Need something like this: <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.10</version> <exclusions> <exclusion> <artifactId>jaas</artifactId> <groupId>jaas</groupId> </exclusion> </exclusions> </plugin> I use IBM java, and java have this jar too, and i need use this jar only from JDK, not from jetty plugin. Now i have conflict.
          Hide
          Jörg von Frantzius added a comment -

          I'd put it that way: it should be possible to define the plugins classpath using the same concepts as the dependencies classpath. Which includes "exclusions"

          Show
          Jörg von Frantzius added a comment - I'd put it that way: it should be possible to define the plugins classpath using the same concepts as the dependencies classpath. Which includes "exclusions"
          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014
          Hide
          Jason van Zyl added a comment -

          Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Hobson
            • Votes:
              34 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: