Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365351 - Excluding Artifact results in wrong POM
Summary: Excluding Artifact results in wrong POM
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-01 13:45 EST by Karl Heinz Marbaise CLA
Modified: 2021-04-19 13:25 EDT (History)
1 user (show)

See Also:


Attachments
Picture 1 (23.53 KB, image/png)
2011-12-01 13:45 EST, Karl Heinz Marbaise CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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/