Skip to content

Exclude junit-jupiter from maven-it-plugin-project-interpolation's dep on maven-it-helper - #461

Open
gnodet wants to merge 1 commit into
apache:maven-3.9.xfrom
gnodet:fix/junit-jupiter-exclusion-39x
Open

gnodet wants to merge 1 commit into
apache:maven-3.9.xfrom
gnodet:fix/junit-jupiter-exclusion-39x

Conversation

@gnodet

@gnodet gnodet commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Problem

When Maven loads maven-it-plugin-project-interpolation:2.1-SNAPSHOT during a forked IT execution, it needs to resolve the plugin's transitive dependencies. The plugin depends on maven-it-helper, which declares org.junit.jupiter:junit-jupiter:5.8.0 as a compile-scope dependency.

The IT suite configures a settings.xml that redirects central to file:target/null to enforce that all required artifacts come from the pre-populated it-local-repo. However junit-jupiter:5.8.0 is not installed into it-local-repo by the outer build (it is downloaded as a build-time dep, not installed as a plugin runtime dep), so the forked Maven fails with:

Could not find artifact org.junit.jupiter:junit-jupiter:jar:5.8.0
in central (file:target/null)

Fix

Add org.junit.jupiter:junit-jupiter to the exclusion list on the maven-it-helper dependency in the plugin POM. The other test-only deps (maven-artifact, maven-verifier, junit:junit) were already excluded; this adds the matching JUnit 5 exclusion.

The plugin code itself does not import or use junit-jupiter at all — the dep on maven-it-helper exists solely to exercise Maven's ${project.version} interpolation in a plugin's dependency section.

…p on maven-it-helper

junit-jupiter is a compile-scope dep of maven-it-helper but it is not
needed at runtime by the plugin itself. Without the exclusion the IT
local repo (which is isolated from central by a file:target/null mirror)
cannot resolve junit-jupiter:5.8.0 when Maven loads the plugin during
forked IT executions, causing:

  Could not find artifact org.junit.jupiter:junit-jupiter:jar:5.8.0
  in central (file:target/null)

The existing exclusions already strip maven-artifact, maven-verifier and
junit (JUnit 4). This adds the matching JUnit 5 exclusion.
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.

1 participant