[jira] [Commented] (MNG-7563) User properties now override model properties in dependencies

2022-12-15 Thread Michael Osipov (Jira)


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

Michael Osipov commented on MNG-7563:
-

[~h...@apteryx.fr], after a talk with [~romain.manni-bucau] and [~hboutemy], I 
will revert this change and prepare 3.8.7 along with other fixes end of year. 
We won't re-apply this change in any manner until we fully understand the 
implications and changes done by it.

> User properties now override model properties in dependencies
> -
>
> Key: MNG-7563
> URL: https://issues.apache.org/jira/browse/MNG-7563
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies, POM
>Affects Versions: 3.8.5, 3.8.6
>Reporter: Hervé Guillemet
>Assignee: Michael Osipov
>Priority: Major
> Fix For: waiting-for-feedback
>
> Attachments: poms.zip
>
>
> An important change has been introduced in 3.8.5 that breaks some existing 
> builds: Java system properties now take precedence over default values of 
> user properties in dependency POMs. This look like a bug since it's now easy 
> to affect dependency behaviors with system properties, a practice that has 
> been discouraged. But maybe do you consider this as a new feature ?
> As an example, 3 poms are attached to this ticket.
> After installing projects b and c, building project a with:
> {{mvn package -Ddep=x}}
> used to succeed until 3.8.4 (-D is ignored) but throws error with 3.8.5 and 
> 3.8.6 (-D override the default).
> Note that without the setting of the default value for property {{dep}} in 
> project b, the build fails with any version of Maven.



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


[jira] [Commented] (MNG-7563) User properties now override model properties in dependencies

2022-12-14 Thread Romain Manni-Bucau (Jira)


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

Romain Manni-Bucau commented on MNG-7563:
-

Hi,

 

Think we should normalise the behavior to always enable to override a value by 
the most specific setting, ie system properties in our case. So model would be 
overriden by user props which is overriden by system props.

The rational is double:

* an user should ultimately control what he builds so more specific is the 
setting more it overrides others (as in most system actually)

* if you to try to lock the value with the definition, then you fall in the 
trap to force the end user to not set the value and force it to be required at 
the highest level you want (user or system props) which is a big anti-pattern 
because you can't build without specific settings anymore.

> User properties now override model properties in dependencies
> -
>
> Key: MNG-7563
> URL: https://issues.apache.org/jira/browse/MNG-7563
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies, POM
>Affects Versions: 3.8.5, 3.8.6
>Reporter: Hervé Guillemet
>Assignee: Michael Osipov
>Priority: Major
> Fix For: waiting-for-feedback
>
> Attachments: poms.zip
>
>
> An important change has been introduced in 3.8.5 that breaks some existing 
> builds: Java system properties now take precedence over default values of 
> user properties in dependency POMs. This look like a bug since it's now easy 
> to affect dependency behaviors with system properties, a practice that has 
> been discouraged. But maybe do you consider this as a new feature ?
> As an example, 3 poms are attached to this ticket.
> After installing projects b and c, building project a with:
> {{mvn package -Ddep=x}}
> used to succeed until 3.8.4 (-D is ignored) but throws error with 3.8.5 and 
> 3.8.6 (-D override the default).
> Note that without the setting of the default value for property {{dep}} in 
> project b, the build fails with any version of Maven.



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


[jira] [Commented] (MNG-7563) User properties now override model properties in dependencies

2022-12-13 Thread Jira


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

Hervé Guillemet commented on MNG-7563:
--

I'm not familiar enough with maven internals to have any strong opinion about 
what is the right and what is wrong here. I just reported a breaking change 
that looks important to me.

But, if it helps, here are two comments:
 * if the developer of an artifact wants his artifact to react to some settings 
from the end user,  he must configure voluntarily for this, so that it won't 
happen by accident. I guess the proper way to do this is to define a profile 
that could be activated using -P or maybe with a true system property.
 * it's difficult for a user to understand how system property and user 
property interact. I understand that this will change in Maven 4 but I don't 
know how. My expectation would be that user properties somehow only concern the 
model written by the user, and that system properties are somehow global to the 
system. Keeping these two kind of properties separated would avoid confusion.

Sorry if I'm just stating the obvious.

> User properties now override model properties in dependencies
> -
>
> Key: MNG-7563
> URL: https://issues.apache.org/jira/browse/MNG-7563
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies, POM
>Affects Versions: 3.8.5, 3.8.6
>Reporter: Hervé Guillemet
>Assignee: Michael Osipov
>Priority: Major
> Fix For: waiting-for-feedback
>
> Attachments: poms.zip
>
>
> An important change has been introduced in 3.8.5 that breaks some existing 
> builds: Java system properties now take precedence over default values of 
> user properties in dependency POMs. This look like a bug since it's now easy 
> to affect dependency behaviors with system properties, a practice that has 
> been discouraged. But maybe do you consider this as a new feature ?
> As an example, 3 poms are attached to this ticket.
> After installing projects b and c, building project a with:
> {{mvn package -Ddep=x}}
> used to succeed until 3.8.4 (-D is ignored) but throws error with 3.8.5 and 
> 3.8.6 (-D override the default).
> Note that without the setting of the default value for property {{dep}} in 
> project b, the build fails with any version of Maven.



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


[jira] [Commented] (MNG-7563) User properties now override model properties in dependencies

2022-12-13 Thread Michael Osipov (Jira)


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

Michael Osipov commented on MNG-7563:
-

I need to revert my previous statement: {{MAVEN_OPTS}} does not change the 
behavior! Looking again at the fix in here: 
https://github.com/apache/maven/pull/306/files#diff-ad3fd714d4f142348b18532c5019eb27e2a3d8eb533ca5702247e86758de8db2R219-R220
 is the change which cases this to be evaluated: 
https://github.com/apache/maven/blob/adf89ef63ffca07e490f5cc550f9411bad1a7bd6/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L1287-L1291
The user property kicks in before your model property kicks in. In the previous 
behavior both user and system properties were merged on purpose into system 
properties to have a lower precedence compared to model properties.

We need now a canonical decision on how to proceed here and is right or wrong. 
Neither is wrong and neither is right at the moment.

> User properties now override model properties in dependencies
> -
>
> Key: MNG-7563
> URL: https://issues.apache.org/jira/browse/MNG-7563
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies, POM
>Affects Versions: 3.8.5, 3.8.6
>Reporter: Hervé Guillemet
>Assignee: Michael Osipov
>Priority: Major
> Fix For: waiting-for-feedback
>
> Attachments: poms.zip
>
>
> An important change has been introduced in 3.8.5 that breaks some existing 
> builds: Java system properties now take precedence over default values of 
> user properties in dependency POMs. This look like a bug since it's now easy 
> to affect dependency behaviors with system properties, a practice that has 
> been discouraged. But maybe do you consider this as a new feature ?
> As an example, 3 poms are attached to this ticket.
> After installing projects b and c, building project a with:
> {{mvn package -Ddep=x}}
> used to succeed until 3.8.4 (-D is ignored) but throws error with 3.8.5 and 
> 3.8.6 (-D override the default).
> Note that without the setting of the default value for property {{dep}} in 
> project b, the build fails with any version of Maven.



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


[jira] [Commented] (MNG-7563) User properties now override model properties in dependencies

2022-12-10 Thread Michael Osipov (Jira)


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

Michael Osipov commented on MNG-7563:
-

[~gnodet], [~slachiewicz], [~cstamas], [~rfscholte], what is your opinion on 
this?  Please also read MNG-5982.

> User properties now override model properties in dependencies
> -
>
> Key: MNG-7563
> URL: https://issues.apache.org/jira/browse/MNG-7563
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies, POM
>Affects Versions: 3.8.5, 3.8.6
>Reporter: Hervé Guillemet
>Assignee: Michael Osipov
>Priority: Major
> Fix For: waiting-for-feedback
>
> Attachments: poms.zip
>
>
> An important change has been introduced in 3.8.5 that breaks some existing 
> builds: Java system properties now take precedence over default values of 
> user properties in dependency POMs. This look like a bug since it's now easy 
> to affect dependency behaviors with system properties, a practice that has 
> been discouraged. But maybe do you consider this as a new feature ?
> As an example, 3 poms are attached to this ticket.
> After installing projects b and c, building project a with:
> {{mvn package -Ddep=x}}
> used to succeed until 3.8.4 (-D is ignored) but throws error with 3.8.5 and 
> 3.8.6 (-D override the default).
> Note that without the setting of the default value for property {{dep}} in 
> project b, the build fails with any version of Maven.



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