Skip to content

Enable Maven 4#215

Merged
Bukama merged 9 commits into
apache:masterfrom
Bukama:enablemaven4
Jun 12, 2026
Merged

Enable Maven 4#215
Bukama merged 9 commits into
apache:masterfrom
Bukama:enablemaven4

Conversation

@Bukama

@Bukama Bukama commented May 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Bukama Bukama self-assigned this May 16, 2026
@Bukama

Bukama commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Note: This PR is for checking build status for Maven 4.0.0 according to checklist https://cwiki.apache.org/confluence/display/MAVEN/Maven+4.0.0+GA+checklist

@Bukama

Bukama commented May 18, 2026

Copy link
Copy Markdown
Contributor Author
D:\Github\Maven\maven-jmod-plugin>mvn --version
Apache Maven 4.0.0-rc-5 (fb3ecaef88106acb40467a450248dfdbd75f3b35)
Maven home: C:\apache-maven-4.0.0-rc-5
Java version: 25.0.2, vendor: Azul Systems, Inc., runtime: C:\Program Files\Zulu\zulu-25
Default locale: de_DE, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "winnt"


[INFO] Build Summary:
[INFO]   Passed: 8, Failed: 7, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[ERROR] The following builds failed:
[ERROR] *  buildinfo-mono\pom.xml
[ERROR] *  buildinfo-multi\pom.xml
[ERROR] *  buildinfo-skip-install-deploy\pom.xml
[ERROR] *  compare-flatten\pom.xml
[ERROR] *  compare-mono\pom.xml
[ERROR] *  compare-resume\pom.xml
[ERROR] *  git-multi\pom.xml

buildinfo-mono
buildinfo-multi

(Logs from buildinfo-mono)

Assertion expects two output entries, the first beeing the buildinfo (ok), the second the jar. But the jar is the third when building with Maven 4. The second is outputs.1.filename=mono-1.0-SNAPSHOT-build.pom according to logs. But in directory there is only consumer-17696942139801610378.pom (next to buildinfo and jar).

Assertion failed: 

assert buildinfo.contains( "outputs.1.filename=mono-1.0-SNAPSHOT.jar" )
       |         |
       |         false
       '# https://reproducible-builds.org/docs/jvm/\r\nbuildinfo.version=1.0-SNAPSHOT\r\n\r\nname=mono\r\ngroup-id=org.apache.maven.plugins.it\r\nartifact-id=mono\r\nversion=1.0-SNAPSHOT\r\n\r\n# source information\r\nsource.scm.uri=scm:git:https://gitbox.apache.org/repos/asf/maven-studies.git\r\nsource.scm.tag=maven-buildinfo-plugin\r\n\r\n# build instructions\r\nbuild-tool=mvn\r\n\r\n# effective build environment information\r\njava.version=25.0.2\r\njava.vendor=Azul Systems, Inc.\r\nos.name=Windows 11\r\nos.version=10.0\r\nos.arch=amd64\r\nline.separator=\\r\\n\r\n\r\n# Maven rebuild instructions and effective environment\r\nmvn.version=4.0.0-rc-5\r\nmvn.minimum.version=3.0.5\r\nmvn.rebuild-args=-Dmaven.session.versionFilter=e(org.slf4j:slf4j-api:(1.7.36,))\r\n\r\n# output\r\n\r\noutputs.0.groupId=org.apache.maven.plugins.it\r\noutputs.0.filename=mono-1.0-SNAPSHOT.pom\r\noutputs.0.length=1921\r\noutputs.0.checksums.sha512=57f42bf97a0d1359d1038e79f0005b238e5154a818e2ca0e83d72210d4bb2f6a34c6c07bd83ebcee54b80bb6d7ea23e31900bbb32eba40437e408ca2028287bc\r\n\r\noutputs.1.groupId=org.apache.maven.plugins.it\r\noutputs.1.filename=mono-1.0-SNAPSHOT-build.pom\r\noutputs.1.length=2799\r\noutputs.1.checksums.sha512=e88e93cd200d2a75653ee28e759b1bd081d19b15f57a0ddffc96d54d6b8917f4d2bd4a8a3881a16822c4203dd59990eba4881629686243a4fe438f67703440d1\r\n\r\noutputs.2.groupId=org.apache.maven.plugins.it\r\noutputs.2.filename=mono-1.0-SNAPSHOT.jar\r\noutputs.2.length=2403\r\noutputs.2.checksums.sha512=43a38add4e1c1f1d568b7307f3fc6354a6b283083827256b8e9f43df1a22aac5e3e7190815619a4af0b0cee95cbf77369147eafcb6d63759e2d85bbb7ae563ab\r\n'

buildinfo-skip-install-deploy
compare-flatten
compare-resume
git-multi

These have the following build error (logs from buildinfo-skip-install-deploy)

[INFO] Reactor Summary for multi 1.0-SNAPSHOT:
[INFO] 
[INFO] multi .............................................. FAILURE [  0.532 s]
[INFO] multi-module module that skips install ............. SKIPPED
[INFO] multi-module module that skips deploy .............. SKIPPED
[INFO] multi-module module that will be skipped by configuring artifact plugin with skipModules SKIPPED
[INFO] multi-module module A .............................. SKIPPED
[INFO] multi-module module B .............................. SKIPPED
[INFO] last module, that skips install .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.701 s
[INFO] Finished at: 2026-05-18T20:52:12+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-artifact-plugin:3.6.2-SNAPSHOT:buildinfo (default) on project multi: Execution default of goal org.apache.maven.plugins:maven-artifact-plugin:3.6.2-SNAPSHOT:buildinfo failed: Cannot invoke "org.apache.maven.model.PluginManagement.getPluginsAsMap()" because the return value of "org.apache.maven.project.MavenProject.getPluginManagement()" is null -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-artifact-plugin:3.6.2-SNAPSHOT:buildinfo (default) on project multi: Execution default of goal org.apache.maven.plugins:maven-artifact-plugin:3.6.2-SNAPSHOT:buildinfo failed: Cannot invoke "org.apache.maven.model.PluginManagement.getPluginsAsMap()" because the return value of "org.apache.maven.project.MavenProject.getPluginManagement()" is null

compare-mono

Build error on compare goal

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.168 s
[INFO] Finished at: 2026-05-18T20:52:49+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-artifact-plugin:3.6.2-SNAPSHOT:compare (default-cli) on project mono: Rebuilt artifacts are different from reference -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-artifact-plugin:3.6.2-SNAPSHOT:compare (default-cli) on project mono: Rebuilt artifacts are different from reference

@Bukama

Bukama commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Working on it

@Bukama

Bukama commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Rebased branch on current master

buildinfo-skip-install-deploy
compare-flatten
compare-resume
git-multi

Setting install and deploy-plugin in plugin-management to parent version fixes the compile errors.
compare-resume and git-multi tests are green with those versions.

buildinfo-skip-install-deploy
compare-flatten

still fail, due other file order with the Maven 4 build-pom (like the two other tests above), so we need to have different assertions in maven 3/4. I will adjust this.

compare-mono fails due RAT missing licences in build-info. Will exclude this next time and test further.

@Bukama

Bukama commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Local build Maven 4.0.0-rc5

[INFO] BUILD SUCCESS
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  02:59 min
[INFO] Finished at: 2026-06-11T21:16:51+02:00

Local build with Maven 3.9.16

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:01 min
[INFO] Finished at: 2026-06-11T21:27:46+02:00
[INFO] ------------------------------------------------------------------------

edit: But GHA build fails to spotless in two IT poms - will fix.
edit 2: Fixed

@Bukama

Bukama commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Summary:

  • Used fixed versions for plugins (esp. install-p and deploy-p)
  • Configure a-rat-p to exclude build-info.log.1 if IT's parent is a specific maven-parent (and not default-parent)
  • Adjust assertions
    ** File indexes in .buildinfo die additional -build.pom
    ** Adjust other remote-repository when using Maven 4 (onlye one remote-repo in basedir, but not in every subproject folder)
    ** Exclude -build.pom when existence of .buildinfo is checked

@hboutemy hboutemy left a comment

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.

great job, thanks

@Bukama Bukama merged commit 8fc3113 into apache:master Jun 12, 2026
17 checks passed
@Bukama Bukama deleted the enablemaven4 branch June 12, 2026 04:14
@github-actions

Copy link
Copy Markdown

@Bukama Please assign appropriate label to PR according to the type of change.

@github-actions github-actions Bot added this to the 3.6.2 milestone Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants