Skip to content

Support Maven <exclusions> syntax within target <dependency> elements#2170

Open
vogella wants to merge 1 commit into
eclipse-m2e:mainfrom
vogella:issue-286-maven-exclusion-syntax
Open

Support Maven <exclusions> syntax within target <dependency> elements#2170
vogella wants to merge 1 commit into
eclipse-m2e:mainfrom
vogella:issue-286-maven-exclusion-syntax

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 10, 2026

Closes #286

The m2-pde target location now accepts the standard Maven <exclusions>/<exclusion> syntax inside each <dependency> element, in addition to the existing location-level <exclude> elements.

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.9.3</version>
    <exclusions>
        <exclusion>
            <groupId>org.apiguardian</groupId>
            <artifactId>apiguardian-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Exclusions are per-dependency (not global) and are applied during transitive dependency collection via MavenDependencyCollector, consistent with standard Maven semantics. The * wildcard is supported for groupId and artifactId. The format round-trips correctly through serialize()/parse.

@github-actions
Copy link
Copy Markdown

Test Results

  336 files  ± 0    336 suites  ±0   1h 3m 24s ⏱️ - 7m 6s
  718 tests + 4    699 ✅ + 3  16 💤 ±0  1 ❌ ±0  2 🔥 +1 
2 154 runs  +12  2 103 ✅ +11  48 💤 ±0  1 ❌ ±0  2 🔥 +1 

For more details on these failures and errors, see this check.

Results for commit 21c6ca4. ± Comparison against base commit 98b66b5.

@laeubi
Copy link
Copy Markdown
Member

laeubi commented May 10, 2026

I'm missing UI integration for this feature through the target location editor and the dependency tree.

Additionally we already have a way to exclude dependencies, so one would expect this code path to be enhanced instead of adding a complete new codepath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

move custom 'exclude' to 'dependency' element

2 participants