You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brett Porter <br...@apache.org> on 2005/05/12 08:16:03 UTC

proposed pom syntax for safely inheriting values

Hi,

A lot of values in the POM, when inherited, need to be extended to add
the additional path to it. Things like URL, SCM, site distribution URL
are all tedious to reproduce in every child POM just to add
${pom.artifactId} to the end.

One option is to actually add pom.artifactId to the end of each of those
when it is inherited and for now I've done just that.

However, I anticipate this won't always be correct - the directory name
may not be pom.artifactId (it may be the intersection of pom.artifactId
and pom.groupId), or it may have an additional path in between, esp when
it comes to subversion.

One alternative I considered was to take the difference between the
parent file location and the current file location, but that relies on
the existence of a USD.

So, I propose the following syntax to be specified in the parent POM:

http://svn.apache.org/repos/asf/maven/wagon/trunk[/${pom.artifactId}]

The value in [...] would be discarded in the POM in which it is defined,
but used in a child, ie:
http://svn.apache.org/repos/asf/maven/wagon/trunk
... in pom.xml
http://svn.apache.org/repos/asf/maven/wagon/trunk/wagon-provider-api
... in wagon-provider-api/pom.xml

This allows a bit more flexiblity, reduces the amount of duplication and
retains the goal of master build == inherited build.

Thoughts?

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: proposed pom syntax for safely inheriting values

Posted by Brett Porter <br...@apache.org>.
I think it would assume to be repeating. ie [/${pom.artifactId}]
indicates "add this to the parent".

I think I'll leave it as appending pom.artifactId at the moment. People
with a layout that differs from that will need to redefine the urls.

- Brett

Mauro Botelho wrote:

>How would that behave when you have multiple levels of inheritance?
>Just assume a flat directory structure?
>
>Mauro
>
>On 5/12/05, Brett Porter <br...@apache.org> wrote:
>  
>
>>Hi,
>>
>>A lot of values in the POM, when inherited, need to be extended to add
>>the additional path to it. Things like URL, SCM, site distribution URL
>>are all tedious to reproduce in every child POM just to add
>>${pom.artifactId} to the end.
>>
>>One option is to actually add pom.artifactId to the end of each of those
>>when it is inherited and for now I've done just that.
>>
>>However, I anticipate this won't always be correct - the directory name
>>may not be pom.artifactId (it may be the intersection of pom.artifactId
>>and pom.groupId), or it may have an additional path in between, esp when
>>it comes to subversion.
>>
>>One alternative I considered was to take the difference between the
>>parent file location and the current file location, but that relies on
>>the existence of a USD.
>>
>>So, I propose the following syntax to be specified in the parent POM:
>>
>>http://svn.apache.org/repos/asf/maven/wagon/trunk[/${pom.artifactId}]
>>
>>The value in [...] would be discarded in the POM in which it is defined,
>>but used in a child, ie:
>>http://svn.apache.org/repos/asf/maven/wagon/trunk
>>... in pom.xml
>>http://svn.apache.org/repos/asf/maven/wagon/trunk/wagon-provider-api
>>... in wagon-provider-api/pom.xml
>>
>>This allows a bit more flexiblity, reduces the amount of duplication and
>>retains the goal of master build == inherited build.
>>
>>Thoughts?
>>
>>- Brett
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: proposed pom syntax for safely inheriting values

Posted by Mauro Botelho <ma...@gmail.com>.
How would that behave when you have multiple levels of inheritance?
Just assume a flat directory structure?

Mauro

On 5/12/05, Brett Porter <br...@apache.org> wrote:
> Hi,
> 
> A lot of values in the POM, when inherited, need to be extended to add
> the additional path to it. Things like URL, SCM, site distribution URL
> are all tedious to reproduce in every child POM just to add
> ${pom.artifactId} to the end.
> 
> One option is to actually add pom.artifactId to the end of each of those
> when it is inherited and for now I've done just that.
> 
> However, I anticipate this won't always be correct - the directory name
> may not be pom.artifactId (it may be the intersection of pom.artifactId
> and pom.groupId), or it may have an additional path in between, esp when
> it comes to subversion.
> 
> One alternative I considered was to take the difference between the
> parent file location and the current file location, but that relies on
> the existence of a USD.
> 
> So, I propose the following syntax to be specified in the parent POM:
> 
> http://svn.apache.org/repos/asf/maven/wagon/trunk[/${pom.artifactId}]
> 
> The value in [...] would be discarded in the POM in which it is defined,
> but used in a child, ie:
> http://svn.apache.org/repos/asf/maven/wagon/trunk
> ... in pom.xml
> http://svn.apache.org/repos/asf/maven/wagon/trunk/wagon-provider-api
> ... in wagon-provider-api/pom.xml
> 
> This allows a bit more flexiblity, reduces the amount of duplication and
> retains the goal of master build == inherited build.
> 
> Thoughts?
> 
> - Brett
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org