You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Robert Munteanu <ro...@apache.org> on 2015/05/06 15:19:31 UTC

Setting parent.relativePath in pom.xml

Hi,

I noticed that we are not consistent in setting parent.relativePath on
pom.xml files. Some modules set it to the empty value, e.g.

    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>22</version>
        <relativePath />
    </parent>

while others set it to the relative path of the parent module in the
SVN checkout

    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>22</version>
        <relativePath>../../parent/pom.xml</relativePath>
    </parent>

We also had a query from Sandro on the users@sling [1] which leads me
to believe that different Maven versions handle this property
differently. While older versions, like we have on Jenkins, prefer the
groupId/artifactId/version coordinates defined in the pom, more recent
versions pick up a pom from the relativePath even if the version does
not match.

To ensure that we get reproducible builds and since we expect to
always deploy the parent pom in a Maven repository I propose that we
should always set the relativePath to be empty.

Thoughts?

Cheers,

Robert


[1]: http://sling-users.markmail.org/search/?q=#query:+page:2+mid:qk3ydifmrkyxbxcp+state:results

Re: Setting parent.relativePath in pom.xml

Posted by Konrad Windszus <ko...@gmx.de>.
+1, more information is also available at https://jira.codehaus.org/browse/MNG-4687 and indeed Maven seems to prefer local resolution in cases where the relativePath is not set explicitly empty!
Konrad

> Am 06.05.2015 um 15:19 schrieb Robert Munteanu <ro...@apache.org>:
> 
> Hi,
> 
> I noticed that we are not consistent in setting parent.relativePath on
> pom.xml files. Some modules set it to the empty value, e.g.
> 
>    <parent>
>        <groupId>org.apache.sling</groupId>
>        <artifactId>sling</artifactId>
>        <version>22</version>
>        <relativePath />
>    </parent>
> 
> while others set it to the relative path of the parent module in the
> SVN checkout
> 
>    <parent>
>        <groupId>org.apache.sling</groupId>
>        <artifactId>sling</artifactId>
>        <version>22</version>
>        <relativePath>../../parent/pom.xml</relativePath>
>    </parent>
> 
> We also had a query from Sandro on the users@sling [1] which leads me
> to believe that different Maven versions handle this property
> differently. While older versions, like we have on Jenkins, prefer the
> groupId/artifactId/version coordinates defined in the pom, more recent
> versions pick up a pom from the relativePath even if the version does
> not match.
> 
> To ensure that we get reproducible builds and since we expect to
> always deploy the parent pom in a Maven repository I propose that we
> should always set the relativePath to be empty.
> 
> Thoughts?
> 
> Cheers,
> 
> Robert
> 
> 
> [1]: http://sling-users.markmail.org/search/?q=#query:+page:2+mid:qk3ydifmrkyxbxcp+state:results


Re: Setting parent.relativePath in pom.xml

Posted by Carsten Ziegeler <cz...@apache.org>.
Am 06.05.15 um 15:19 schrieb Robert Munteanu:
> 
> To ensure that we get reproducible builds and since we expect to
> always deploy the parent pom in a Maven repository I propose that we
> should always set the relativePath to be empty.
>
> Thoughts?

+1

Carsten

> 
> Cheers,
> 
> Robert
> 
> 
> [1]: http://sling-users.markmail.org/search/?q=#query:+page:2+mid:qk3ydifmrkyxbxcp+state:results
> 


-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: Setting parent.relativePath in pom.xml

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Thursday 07 May 2015 13:40:29 Robert Munteanu wrote:
> On Thu, 2015-05-07 at 12:05 +0200, Oliver Lietz wrote:
> > On Thursday 07 May 2015 12:46:20 Robert Munteanu wrote:
> > > On Wed, May 6, 2015 at 10:27 PM, Oliver Lietz <
> > > 
> > > apache@oliverlietz.de> wrote:
> > > > Can we add such "best practices" to our documentation, please?
> > > 
> > > Can you suggest a proper location? TBH I'm unable to decide where
> > > to
> > > place this information
> > 
> > I would go for site/[...]/documentation/development, so in section
> > Sling
> > Development:
> > http://sling.apache.org/documentation/development.html#sling
> > -development
> 
> Good point. Created
> 
>   http://sling.apache.org/documentation/development/maven-usage.html

Looks good - thanks, Robert!

O.

> Robert


Re: Setting parent.relativePath in pom.xml

Posted by Robert Munteanu <ro...@apache.org>.
On Thu, 2015-05-07 at 12:05 +0200, Oliver Lietz wrote:
> On Thursday 07 May 2015 12:46:20 Robert Munteanu wrote:
> > On Wed, May 6, 2015 at 10:27 PM, Oliver Lietz <
> > apache@oliverlietz.de> wrote:
> > > Can we add such "best practices" to our documentation, please?
> > 
> > Can you suggest a proper location? TBH I'm unable to decide where 
> > to
> > place this information
> 
> I would go for site/[...]/documentation/development, so in section 
> Sling 
> Development:
> http://sling.apache.org/documentation/development.html#sling
> -development

Good point. Created

  http://sling.apache.org/documentation/development/maven-usage.html

Robert

Re: Setting parent.relativePath in pom.xml

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Thursday 07 May 2015 12:46:20 Robert Munteanu wrote:
> On Wed, May 6, 2015 at 10:27 PM, Oliver Lietz <ap...@oliverlietz.de> wrote:
> > Can we add such "best practices" to our documentation, please?
> 
> Can you suggest a proper location? TBH I'm unable to decide where to
> place this information

I would go for site/[...]/documentation/development, so in section Sling 
Development:
http://sling.apache.org/documentation/development.html#sling-development

Regards,
O.

> Robert


Re: Setting parent.relativePath in pom.xml

Posted by Robert Munteanu <ro...@lmn.ro>.
On Wed, May 6, 2015 at 10:27 PM, Oliver Lietz <ap...@oliverlietz.de> wrote:
>
> Can we add such "best practices" to our documentation, please?


Can you suggest a proper location? TBH I'm unable to decide where to
place this information

Robert

-- 
Sent from my (old) computer

Re: Setting parent.relativePath in pom.xml

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Wednesday 06 May 2015 16:19:31 Robert Munteanu wrote:
> Hi,
> 
> I noticed that we are not consistent in setting parent.relativePath on
> pom.xml files. Some modules set it to the empty value, e.g.
> 
>     <parent>
>         <groupId>org.apache.sling</groupId>
>         <artifactId>sling</artifactId>
>         <version>22</version>
>         <relativePath />
>     </parent>
> 
> while others set it to the relative path of the parent module in the
> SVN checkout
> 
>     <parent>
>         <groupId>org.apache.sling</groupId>
>         <artifactId>sling</artifactId>
>         <version>22</version>
>         <relativePath>../../parent/pom.xml</relativePath>
>     </parent>
> 
> We also had a query from Sandro on the users@sling [1] which leads me
> to believe that different Maven versions handle this property
> differently. While older versions, like we have on Jenkins, prefer the
> groupId/artifactId/version coordinates defined in the pom, more recent
> versions pick up a pom from the relativePath even if the version does
> not match.
> 
> To ensure that we get reproducible builds and since we expect to
> always deploy the parent pom in a Maven repository I propose that we
> should always set the relativePath to be empty.
> 
> Thoughts?

+1 though you have to build parent yourself when SNAPSHOT is used by that 
module

Can we add such "best practices" to our documentation, please?

Regards,
O.

> Cheers,
> 
> Robert
> 
> 
> [1]:
> http://sling-users.markmail.org/search/?q=#query:+page:2+mid:qk3ydifmrkyxbx
> cp+state:results