You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2023/11/17 15:08:00 UTC

[jira] [Comment Edited] (MNG-7923) Jenkins core does not compile with Maven 4.x

    [ https://issues.apache.org/jira/browse/MNG-7923?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17787249#comment-17787249 ] 

Guillaume Nodet edited comment on MNG-7923 at 11/17/23 3:07 PM:
----------------------------------------------------------------

The CIFriendly feature is broken on both Maven 4 since the introduction of the build/consumer POM feature. The reason is that the interpolation is now done before assembling the hierarchy when computing the effective POM. So in Maven 4, POMs are loaded, interpolated, then merged.  So the ci-friendly properties which are defined in the parent pom are not available at the time the child is being loaded.

In Maven 3, this is working, but the parent happens to be loaded with an un-interpolated version.  It kinda works because the model builder tried to find the parent with a version of {{${revision}${changelist}}} and actually founds one in the parent folder.

I'd suggest to stick to the tested scenarios, which is to define the CI-friendly versions externally using system properties that can be defined in {{.mvn/maven.config}} using:
{code}
-Drevision=2.433
-Dchangelist=-SNAPSHOT
{code}


was (Author: gnt):
Ok, the CIFriendly feature is broken on both Maven 4 since the introduction of the build/consumer POM feature.
The reason is that the interpolation is now done before assembling the hierarchy when computing the effective POM.
So in maven 4, POM are loaded, interpolated, then merged.  So the ci-friendly properties which are defined in the parent pom are not available when loading the child yet.

In Maven 3, this is working, but the parent happens to be loaded with an un-interpolated version.  It kinda works because the model builder tried to find the parent with a version of {{${revision}${changelist}}} and actually founds one in the parent folder.

I'd suggest to stick to the tested scenarios, which is to define the CI-friendly versions externally using system properties that can be defined in {{.mvn/maven.config}} using:
{code}
-Drevision=2.433
-Dchangelist=-SNAPSHOT
{code}

> Jenkins core does not compile with Maven 4.x
> --------------------------------------------
>
>                 Key: MNG-7923
>                 URL: https://issues.apache.org/jira/browse/MNG-7923
>             Project: Maven
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 4.0.0-alpha-8
>            Reporter: Basil Crow
>            Priority: Major
>
> Try running {{git clone https://github.com/jenkinsci/jenkins.git && cd jenkins && mvn verify -Pquick-build}}. On the latest version of Maven 3.x, it works; on the latest Maven 4.x alpha, the build fails immediately with "Non-resolvable import POM: The following artifacts could not be resolved". If we need to make changes to our POM, then please point me to the documentation; otherwise, please fix the bug and let me know which release of Maven 4.x alpha I can test with the bug fixed. I bisected the failure to MNG-6656 / https://github.com/apache/maven/commit/bdec668de9c600165bb69c95b6ea0625d9f74fb0



--
This message was sent by Atlassian Jira
(v8.20.10#820010)