Skip to content

Fix IT failures on Maven 4 (transporter: NoTransporterException for file:// protocol)#309

Closed
elharo wants to merge 4 commits into
apache:masterfrom
elharo:master
Closed

Fix IT failures on Maven 4 (transporter: NoTransporterException for file:// protocol)#309
elharo wants to merge 4 commits into
apache:masterfrom
elharo:master

Conversation

@elharo

@elharo elharo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #261

Problem

All 24 integration tests fail on Maven 4 due to NoTransporterException: Unsupported transport protocol file. Maven 4's default resolver does not include a file:// protocol transporter, so the @localRepositoryUrl@ (resolved to a file:// URL) in src/it/settings.xml causes all ITs to fail at dependency resolution.

The reproducible IT also had an additional failure: its assert deployDir.exists() assertion fails because deploy:deploy used a hardcoded maven-deploy-plugin:2.8.2 which is not compatible with Maven 4.

Fix

  1. pom.xml: Added <mavenOpts>-Dmaven.resolver.transport=wagon</mavenOpts> to the maven-invoker-plugin configuration in the run-its profile. This forces Maven to use the Wagon-based transport, which natively supports file:// URLs.

  2. src/it/reproducible/pom.xml: Updated maven-deploy-plugin version from 2.8.2 to 3.1.4, which is compatible with Maven 4.

@elharo
elharo marked this pull request as draft July 20, 2026 22:14
…gin version

Maven 4's default resolver does not include a file:// protocol transporter,
causing all integration tests to fail with NoTransporterException when
resolving artifacts from the local repository.

The fix adds -Dmaven.resolver.transport=wagon to the invoker plugin
configuration, forcing Maven to use the Wagon-based transport which
natively supports file:// URLs.

Additionally updates the hardcoded maven-deploy-plugin version in the
reproducible IT from 2.8.2 to 3.1.4, which is compatible with Maven 4.

Fixes apache#261
@elharo

elharo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

trigger ci

@elharo

elharo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

trigger ci

@elharo
elharo requested a review from Copilot July 20, 2026 22:40
@elharo elharo added build Pull requests that change the build process priority:blocker Blocks development and/or testing work, production could not run labels Jul 20, 2026
@elharo
elharo requested a review from Bukama July 20, 2026 22:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to restore the project’s Maven Invoker-based integration tests on Maven 4 by ensuring the IT Maven executions can resolve artifacts from a file://-backed repository and by updating an IT to use a Maven 4–compatible deploy plugin.

Changes:

  • Force IT Maven executions (via maven-invoker-plugin) to use the Wagon transporter so file:// repositories work on Maven 4.
  • Update the reproducible IT to use maven-deploy-plugin 3.1.4 (instead of 2.8.2) for Maven 4 compatibility.
  • Additional changes included in this PR (site skin config + IT goal list tweak) that are not currently reflected in the PR description.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pom.xml Adds Invoker mavenOpts to force Wagon transport during IT runs (addresses Maven 4 file:// transporter failure).
src/it/reproducible/pom.xml Bumps maven-deploy-plugin to 3.1.4 for Maven 4 compatibility in the reproducible IT.
src/it/reproducible/invoker.properties Adjusts IT invoked goals by adding jar:jar (rationale should be captured in PR description).
src/site/site.xml Adds an explicit Maven Site skin/version (appears unrelated to the stated IT/Maven 4 issue).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/site/site.xml
Comment on lines +24 to 29
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>2.1.0</version>
</skin>
<body>
# under the License.

invoker.goals=remote-resources:process source:jar deploy:deploy
invoker.goals=remote-resources:process jar:jar source:jar deploy:deploy
@elharo
elharo marked this pull request as ready for review July 20, 2026 22:44
@Bukama
Bukama requested a review from ascheman July 21, 2026 07:27
@Bukama

Bukama commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@ascheman I'M in a hurry due vacation preparations. Please have a look. I have in mind that we had this local repository issue in other plugins too. I can also imagine that lifting the plugin to RC5/ (6 aka SNAPSHOT) first, may solve some issue.

According upgrading: Sandra has started (but paused) working on it: #268

@ascheman ascheman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling the reproducible IT, @elharo — adding jar:jar to the goals and bumping the deploy-plugin are sensible IT-plumbing fixes.

I wanted to flag one concern before this lands, based on testing against current Maven 4. I ran this PR's branch in a clean container (fresh ~/.m2, JDK 21) against both 4.0.0-rc-5 and the maven-4.0.x SNAPSHOT (rc-6 candidate). In both cases the reproducible IT fails before the transport/deploy changes are even reached:

[ERROR] Failed to execute goal ...maven-source-plugin:4.0.0-beta-2-SNAPSHOT:jar (default-cli)
        on project reproducible:
        java.lang.NoSuchMethodError:
        org.apache.maven.api.services.ProjectManager.getCompileSourceRoots(Project, ProjectScope)

ProjectManager.getCompileSourceRoots(Project, ProjectScope) was removed before rc-4 (replaced by getSourceRoots(...) / getEnabledSourceRoots(Project, ProjectScope, Language)), while this plugin still builds against 4.0.0-beta-3 and calls the old method in SourceJarNoForkMojo / TestSourceJarNoForkMojo. So the IT here can only pass on beta-3-and-older Maven — which is presumably why CI is green — and fails on every released RC.

That's my hesitation about merging as-is: a fix whose IT passes only on a pre-rc Maven, and fails on rc-4/rc-5/rc-6, isn't really validating Maven 4 compatibility.

The API migration is exactly what #268 (@sparsick) does — it moves those mojos to getEnabledSourceRoots(...). Could we sequence this so the IT plumbing is validated on top of the migrated code against a current/upcoming RC? Concretely, either:

  • fold the IT-plumbing parts of this PR (the jar:jar goal and the deploy-plugin 2.8.2 -> 3.1.4 bump) into #268, so they're verified against the final API, or
  • rebase this PR once the plugin builds against a current RC and re-confirm the IT is green there.

One thing worth re-checking during that rework: whether -Dmaven.resolver.transport=wagon is still needed once deploy-plugin is on 3.1.4 — in a separate test a plain file:// deploy worked with the default transport on current 4.0.x, so the wagon override may be droppable.

Happy to help verify on the RC once the plugin is migrated. (Non-binding review.)

@sparsick

Copy link
Copy Markdown
Contributor

@ascheman I'M in a hurry due vacation preparations. Please have a look. I have in mind that we had this local repository issue in other plugins too. I can also imagine that lifting the plugin to RC5/ (6 aka SNAPSHOT) first, may solve some issue.

According upgrading: Sandra has started (but paused) working on it: #268

Updating to RC5 will end in failing tests (see also my PR #268). Therefore, I paused the work until RC6 is released. After RC6 is released, I will continue

@ascheman

Copy link
Copy Markdown

@ascheman I'M in a hurry due vacation preparations. Please have a look. I have in mind that we had this local repository issue in other plugins too. I can also imagine that lifting the plugin to RC5/ (6 aka SNAPSHOT) first, may solve some issue.
According upgrading: Sandra has started (but paused) working on it: #268

Updating to RC5 will end in failing tests (see also my PR #268). Therefore, I paused the work until RC6 is released. After RC6 is released, I will continue

Yes, we should wait for RC-6 and rework 309 with the latest API changes accordingly (this can already be prepared with RC-5/4.0.x-SNAPSHOT).

@elharo elharo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should wait for RC6. Right now the repo is borked and all work is blocked. This is the minimal change we need to get the CI passing. Details can be revisited after RC6 if that's needed.

@ascheman

Copy link
Copy Markdown

I don't think we should wait for RC6. Right now the repo is borked and all work is blocked. This is the minimal change we need to get the CI passing. Details can be revisited after RC6 if that's needed.

And what does the green CI help in the end? No-one with a recent M4 installation will be able to use it as it is using an API from a beta-version which was changed meanwhile. If someone is really, really on any older version than RC-4, we should heavily recommend to switch to RC-4 or RC-5 (which has small issues).

Meanwhile the fix could be aligned with the new API as described.

@elharo

elharo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

A green CI allows new and existing PRs to move forward. The current state blocks all work. This is not about what's deployed in production (which shouldn't be RC-anything) but rather about whether any work can proceed on this plugin.

Comment thread pom.xml
<goal>install</goal>
</goals>
<addTestClassPath>true</addTestClassPath>
<mavenOpts>-Dmaven.resolver.transport=wagon</mavenOpts>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful with such change .... it turn on old transport which is not used by default
In real use users use default transport so problem can be only hidden here and we test something different which is normally used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is necessary to make the existing tests pass because they use file:// URLs the default transport doesn't support. Perhaps file an issue to fix those tests. However, in the meantime I think it is absolutely essential to get the tests passing. No progress on anything can be made until we do that, and this is the minimal and safest change I could contrive that accomplishes that. Once the CI is green, we can carefully move forward with other fixes without fear of accidentally breaking more things.

The alternative would be to roll everything back to the last known good commit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I suggest to focus on the root cause (-> #310) to make CI green again and leave the transport fix (and clarification of #309 (comment)) for the time beyond merging #268 (which could be prepared nonetheless).

@elharo

elharo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

#310 helps but it doesn't seem to be sufficient. I'm still seeing CI failures on some JDKs (not all) that don't have anything do with fluido or skins or site:


Error executing post-build hook: The post-build script returned false.
--
  |   |   | *** end build.log for: test-jar-no-fork/pom.xml ***
  |   |   |  
  |   |   | [WARNING] -------------------------------------------------
  |   |   | [WARNING]
  |   |   | [INFO] -------------------------------------------------
  |   |   | [INFO] Build Summary:
  |   |   | [INFO]   Passed: 5, Failed: 19, Errors: 0, Skipped: 0
  |   |   | [INFO] -------------------------------------------------
  |   |   | [WARNING] The following builds failed:
  |   |   | [WARNING] *  MSOURCES-95/pom.xml
  |   |   | [WARNING] *  MSOURCES-62/pom.xml
  |   |   | [WARNING] *  jar/pom.xml
  |   |   | [WARNING] *  jar-classifier/pom.xml
  |   |   | [WARNING] *  MSOURCES-64/pom.xml
  |   |   | [WARNING] *  project-without-sources/pom.xml
  |   |   | [WARNING] *  jar-no-fork/pom.xml
  |   |   | [WARNING] *  reproducible/pom.xml
  |   |   | [WARNING] *  jar-attached/pom.xml
  |   |   | [WARNING] *  MSOURCES-121/pom.xml
  |   |   | [WARNING] *  test-jar/pom.xml
  |   |   | [WARNING] *  MSOURCES-140/pom.xml
  |   |   | [WARNING] *  jar-without-descriptor-config/pom.xml
  |   |   | [WARNING] *  test-jar-generated/pom.xml
  |   |   | [WARNING] *  jar-with-archive-config/pom.xml
  |   |   | [WARNING] *  manifest-content/pom.xml
  |   |   | [WARNING] *  test-jar-classifier/pom.xml
  |   |   | [WARNING] *  jar-includes-excludes/pom.xml
  |   |   | [WARNING] *  test-jar-no-fork/pom.xml

@ascheman

Copy link
Copy Markdown

#310 helps but it doesn't seem to be sufficient. I'm still seeing CI failures on some JDKs (not all) that don't have anything do with fluido or skins or site:

Seems to be green now. Do you have a concrete build job reference where it still broke (perhaps a flake)?

@elharo

elharo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

#258 and #257 are both still failing in part. Haven't dug into them in detail yet.

@ascheman

Copy link
Copy Markdown

#258 and #257 are both still failing in part. Haven't dug into them in detail yet.

Perhaps move the discussion to those PRs? To be honest, I wonder why they (still) run on Jenkins? #312 should prevent this ... Are they properly rebased to the current master?

@Bukama

Bukama commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

#258 and #257 are both still failing in part. Haven't dug into them in detail yet.

Perhaps move the discussion to those PRs? To be honest, I wonder why they (still) run on Jenkins? #312 should prevent this ... Are they properly rebased to the current master?

No. They still have the jenkinsfile" instead of jenkinsfile.disabled`

@elharo

elharo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

seems to be working now. I think I pulled master a little too soon and missed #312

@elharo elharo closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process priority:blocker Blocks development and/or testing work, production could not run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IT failings on master

6 participants