Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365351

Summary: Excluding Artifact results in wrong POM
Product: z_Archived Reporter: Karl Heinz Marbaise <eclipse>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: critical    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Picture 1 none

Description Karl Heinz Marbaise CLA 2011-12-01 13:45:11 EST
Created attachment 207807 [details]
Picture 1

I have project (http://github.com/khmarbaise/cli-test Tag: M2E_BUG_POM_REFACTORING) which contains the following dependencies:

  <dependencies>
    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
      <version>1.20</version>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.0.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.14</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
  </dependencies>

If i check the dependencies via "Dependency Hierarchy" i see that there is a conflict (See Picture 1; Attachment).

Them i decided to exclude the dependency jcommander (1.12 conflicting with 1.20) which is comming via testng by using "Exclude Maven artifact". I have selected the line with the jcommander which says: "(omitted for conflict with 1.20)...

After the exclude of the artifact my pom contains only the following:

  <dependencies>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.0.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>jcommander</artifactId>
          <groupId>com.beust</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.14</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
  </dependencies>

which is wrong, cause it removes the dependency to jcommander (1.20) completely which results in compile errors. I wanted to clean up my dependencies in this case an simply exclude jcommander which is transitively comming via testng.

Kind regards
Karl Heinz Marbaise
Comment 1 Igor Fedorenko CLA 2013-09-29 09:52:06 EDT
closing old/stale bugreports
Comment 2 Denis Roy CLA 2021-04-19 13:25:34 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/