Skip to content

[MNG-11966] Update lifecycles reference to point to LifecycleRegistry - #12260

Merged
gnodet merged 6 commits into
apache:masterfrom
Hiteshsai007:issue-11966
Jun 17, 2026
Merged

[MNG-11966] Update lifecycles reference to point to LifecycleRegistry#12260
gnodet merged 6 commits into
apache:masterfrom
Hiteshsai007:issue-11966

Conversation

@Hiteshsai007

Copy link
Copy Markdown
Contributor

MNG-11966: Update lifecycles reference to point to LifecycleRegistry

Proposed Changes

This PR addresses issue #11966 ("Update documentation at - Introduction to the Build Lifecycle").

In PR #11916, legacy Plexus XML descriptors (components.xml and default-bindings.xml) were removed from the maven-core module as part of the migration of the core to JSR-330 / javax.inject.

Consequently, the source file for the generated references page (lifecycles.apt.vm) was still pointing to the old package org.apache.maven.lifecycle.providers for the 3 lifecycles, which is no longer the source of truth.

This change updates lifecycles.apt.vm to point to the new public org.apache.maven.api.services.LifecycleRegistry where the lifecycles are registered and queried in Maven 4.

Checklist

  • Your pull request should address just one issue, without pulling in other changes.

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Each commit in the pull request should have a meaningful subject line and body.

  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. (N/A: Documentation-only change)

  • Run mvn verify to make sure basic checks pass. (N/A: Documentation-only change)

  • You have run the Core IT successfully. (N/A: Documentation-only change)

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

@slachiewicz slachiewicz added the documentation Improvements or additions to documentation label Jun 14, 2026
@Hiteshsai007

Copy link
Copy Markdown
Contributor Author

The windows-latest test failed on Java 25 because of Maven 4's Remote Repository Filtering (RRF).

The test environment runs with the mimir extension. In the integration tests, we already disable RRF inside Verifier#execute(). However, Verifier also makes quick helper calls to Maven under the hood (like when deleteArtifacts() looks up the metadata path at the start of MavenIT0010). Those helper calls are created through Verifier#executorRequest(), which was missing the -Daether.remoteRepositoryFilter flags.

On clean/uncached runners, this caused those helper invocations to run with RRF enabled, query Maven Central, and get blocked because eu.maveniverse isn't in Central's prefixes list.

I've added the disable flags directly in Verifier#executorRequest() so it gets bypassed for helper Maven processes as well. Tested the change locally, and it compiles fine.

@Hiteshsai007

Copy link
Copy Markdown
Contributor Author

Why the old one failed:

On Windows, the integration tests generated the .mvn/jvm.config file with a UTF-8 BOM (\uFEFF) prepended to it. The old JvmConfigParser read this file but did not strip the BOM, passing \uFEFF-Dprop=val directly to the Java 21 launcher. The JVM didn't recognize the corrupted -D option, failing to set the property and causing test assertions to fail.

How the new one works:

The new parser checks for and strips the leading BOM (\uFEFF) character. The clean -Dprop=val is passed to the Java 21 launcher, which successfully sets the system property, allowing all integration tests to pass.

@cstamas

cstamas commented Jun 16, 2026

Copy link
Copy Markdown
Member

Assessment is wrong, while Central prefixes really does not have /eu/maveniverse, it does have /eu which still allows eu.maveniverse... (and any other eu. top level) group IDs.

And due assessment being wrong, the change in this PR is wrong as well.

@Hiteshsai007

Copy link
Copy Markdown
Contributor Author

You are completely correct. The prefix matching in Maven Resolver allows /eu to cover the eu.maveniverse namespace, so remote repository filtering was not the blocker.

I have reverted the changes to Verifier.java from this PR.

The actual root cause of the Windows-specific CI failures was the UTF-8 BOM (\uFEFF) in the generated .mvn/jvm.config file, which was causing the JVM launcher to reject option arguments. The PR now only contains the fix in JvmConfigParser.java to strip the leading BOM.

@cstamas

cstamas commented Jun 16, 2026

Copy link
Copy Markdown
Member

Does UTF-8 care for endianness? How and why did BOM appear in your UTF-8 text file?

@Hiteshsai007

Hiteshsai007 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Does UTF-8 care for endianness? How and why did BOM appear in your UTF-8 text file?

No Sir, UTF-8 doesn't care about endianness at all.

The BOM showed up because a lot of standard Windows tools (like Notepad or default PowerShell redirections) silently prepend the UTF-8 BOM to distinguish the file from legacy ANSI encoding. If a Windows user creates or edits their .mvn/jvm.config with one of these tools, the BOM gets inserted automatically.

Since our parser wasn't stripping it, that invisible \uFEFF character was being passed straight to the JVM launcher (e.g., \uFEFF-Dprop=val), causing the JVM to reject the argument. Stripping it just makes Maven resilient against files saved by default Windows text editors.

@cstamas

cstamas commented Jun 16, 2026

Copy link
Copy Markdown
Member

Given this is not the only file that Maven reads, let's remove this change from this PR (is out of scope for it anyway) and report a Maven issue where we can discuss this.

@Hiteshsai007

Hiteshsai007 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Given this is not the only file that Maven reads, let's remove this change from this PR (is out of scope for it anyway) and report a Maven issue where we can discuss this.

Makes total sense! I've reverted the BOM-stripping changes in JvmConfigParser.java so this PR remains strictly focused on the original lifecycles.apt.vm documentation update.

@elharo elharo changed the title MNG-11966: Update lifecycles reference to point to LifecycleRegistry [MNG-11966] Update lifecycles reference to point to LifecycleRegistry Jun 17, 2026
@Hiteshsai007

Copy link
Copy Markdown
Contributor Author

Thank you for the review and approval. The BOM-related changes have been reverted, and this PR is now focused solely on the lifecycles.apt.vm documentation update. All CI checks are passing.

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM — the link correctly points to LifecycleRegistry in the aggregated Javadoc.

Fully automatic review from Claude Code

@gnodet gnodet self-assigned this Jun 17, 2026
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jun 17, 2026
@gnodet
gnodet merged commit f254df7 into apache:master Jun 17, 2026
22 checks passed
@Hiteshsai007
Hiteshsai007 deleted the issue-11966 branch June 17, 2026 13:20
@Hiteshsai007

Hiteshsai007 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Thank you to everyone who reviewed and supported this contribution. I really appreciate the guidance and feedback throughout the process. (@gnodet @elharo @cstamas @slachiewicz )

I'm also hoping to become a GSoC 2027 contributor with Apache Maven, so being able to contribute here is an exciting step in that journey. Looking forward to contributing more in the future! 🙏

gnodet added a commit that referenced this pull request Jun 17, 2026
…#12260) (#12292)

* MNG-11966: Update lifecycles reference to point to LifecycleRegistry

* [MNG-11966] Disable remote repository filtering in Verifier helper calls

* [MNG-11966] Strip UTF-8 BOM in JvmConfigParser

* Revert "[MNG-11966] Disable remote repository filtering in Verifier helper calls"

This reverts commit 5bc436c.

* Revert BOM stripping in JvmConfigParser.java

Co-authored-by: B V HITESH SAI <hiteshsaibv.24cs@saividya.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants