[jira] [Commented] (MNG-7562) Mechanism for preventing inheritance of sections such as .

2023-06-12 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet commented on MNG-7562:
--

One solution would be to add an attribute on the model specifying a list of 
fields that should not be inherited.
{code}

{code}

However, if you're writing a POM that will be consumed, maybe a better solution 
would be [MNG-5102|https://issues.apache.org/jira/browse/MNG-5102].

> Mechanism for preventing inheritance of sections such as .
> ---
>
> Key: MNG-7562
> URL: https://issues.apache.org/jira/browse/MNG-7562
> Project: Maven
>  Issue Type: Improvement
>  Components: Inheritance and Interpolation
>Affects Versions: 3.8.6
>Reporter: Garret Wilson
>Priority: Major
>
> There needs to a way in the Maven POM to prevent an element from being 
> inherited altogether in child POMs.
> We are currently publishing a Maven POM that is useful to serve as the parent 
> POM for various projects. Some of the projects that use the POM will be open 
> source, but some will not be. To designate our parent POM as open source, we 
> include this:
> {code:xml}
> 
>   
> Apache-2.0
> https://www.apache.org/licenses/LICENSE-2.0
> repo
>   
> 
> {code}
> This essentially says, "this project is open source".
> Unfortunately because of [POM 
> inheritance|https://maven.apache.org/pom.html#Inheritance], any project that 
> uses this parent POM will also effectively be saying "this project is also 
> open source", because the effective POM of all descendant projects will also 
> include this same license section.
> Developers could try to remember to include some {{}} section to 
> override this license, but the whole point of the parent POM is that it 
> should given developers less to do, not more. Besides, some private projects 
> (even ours) might not wish to indicate a license at all!
> There needs to be a way for our public parent POM to indicate that it is open 
> source without effectively making all child projects open source as well 
> through POM inheritance. Preventing the {{}} section from being 
> inherited is one example of a more general mechanism needed to say, "Do not 
> inherit this element at all in child POMs".



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


[jira] [Commented] (MNG-7562) Mechanism for preventing inheritance of sections such as .

2022-10-12 Thread Garret Wilson (Jira)


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

Garret Wilson commented on MNG-7562:


I [asked about this on Stack Overflow|https://stackoverflow.com/q/73239332], 
and someone [suggested|https://stackoverflow.com/a/73983784] 
{{child.licences.append.path=false}}, which is apparently a mechanism 
introduced in MNG-6059 (building on MNG-5951) and documented briefly in [Maven 
Model Builder|https://maven.apache.org/ref/3.8.6/maven-model-builder/]. But 
this mechanism doesn't seem to prevent inheritance—it only seems to prevent 
appending a path to the inherited value, unless I'm reading it incorrectly.

> Mechanism for preventing inheritance of sections such as .
> ---
>
> Key: MNG-7562
> URL: https://issues.apache.org/jira/browse/MNG-7562
> Project: Maven
>  Issue Type: Improvement
>  Components: Inheritance and Interpolation
>Affects Versions: 3.8.6
>Reporter: Garret Wilson
>Priority: Major
>
> There needs to a way in the Maven POM to prevent an element from being 
> inherited altogether in child POMs.
> We are currently publishing a Maven POM that is useful to serve as the parent 
> POM for various projects. Some of the projects that use the POM will be open 
> source, but some will not be. To designate our parent POM as open source, we 
> include this:
> {code:xml}
> 
>   
> Apache-2.0
> https://www.apache.org/licenses/LICENSE-2.0
> repo
>   
> 
> {code}
> This essentially says, "this project is open source".
> Unfortunately because of [POM 
> inheritance|https://maven.apache.org/pom.html#Inheritance], any project that 
> uses this parent POM will also effectively be saying "this project is also 
> open source", because the effective POM of all descendant projects will also 
> include this same license section.
> Developers could try to remember to include some {{}} section to 
> override this license, but the whole point of the parent POM is that it 
> should given developers less to do, not more. Besides, some private projects 
> (even ours) might not wish to indicate a license at all!
> There needs to be a way for our public parent POM to indicate that it is open 
> source without effectively making all child projects open source as well 
> through POM inheritance. Preventing the {{}} section from being 
> inherited is one example.



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