Maven
  1. Maven
  2. MNG-2163

Allow plugin dependencies to be excluded

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Dependencies
    • Labels:
      None
    • Environment:
      Windows XP, Cygwin

      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

          Mark Hobson created issue -
          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?
          John Casey made changes -
          Field Original Value New Value
          Fix Version/s 2.1 [ 11704 ]
          Jason van Zyl made changes -
          Fix Version/s 2.1 [ 11704 ]
          Fix Version/s 2.1.x [ 13142 ]
          Brad Szabo made changes -
          Link This issue is duplicated by MNG-2448 [ MNG-2448 ]
          Brad Szabo made changes -
          Link This issue is duplicated by MNG-2969 [ MNG-2969 ]
          Brad Szabo made changes -
          Link This issue is related to MNG-2972 [ MNG-2972 ]
          Paul Gier made changes -
          Link This issue relates to MNG-3196 [ MNG-3196 ]
          Jason van Zyl made changes -
          Fix Version/s 3.x [ 13145 ]
          Fix Version/s 3.0 [ 13142 ]
          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"
          Benjamin Bentmann made changes -
          Issue Type Bug [ 1 ] New Feature [ 2 ]
          Hide
          lexey4eg 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
          lexey4eg 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.
          Jason van Zyl made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Incomplete [ 4 ]
          Paul Benedict made changes -
          Fix Version/s Issues to be reviewed for 3.x [ 13145 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Mark Thomas made changes -
          Workflow jira [ 12712822 ] Default workflow, editable Closed status [ 12752685 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Workflow jira [ 12949872 ] Default workflow, editable Closed status [ 12986044 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          2864d 9h 39m 1 Jason van Zyl 22/Jan/14 20:32

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development