Global exclusion of artifacts

One thing that would be nice for some of the projects we work on with clients is the ability to globally exclude artifacts.  For example, I would like always to exclude commons-logging and log4j because I am using slf4j and logback instead.  Many third-party artifacts we use depend on one or both of these, and it will be difficult to add an <exclusions> section to each artifact that transitively includes commons-logging.  This feature would most likely need large warning signs that it should not be used except in extreme circumstances and only if you really know what you're doing, as it could lead to odd behavior and broken builds.

Andy

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 12, 2007

    Paul Gier says:

    I agree that this would be a very useful feature. I created this JIRA issue att...

    I agree that this would be a very useful feature. I created this JIRA issue attempting to address the same problem: http://jira.codehaus.org/browse/MNG-3196

    There is also this popular issue: http://jira.codehaus.org/browse/MNG-1977

    I think that the exclusions tag should be added to the dependencies tag both in the main dependencies section, and in the plugin's dependencies section, so you could have something like this:

    <dependencies>
      <exclusions>
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
      </exclusions>
    </dependencies>

    In a plugin definition, this would allow you to override certain plugin dependencies. See this issue:

    http://jira.codehaus.org/browse/MNG-2163