You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jan <ra...@gmail.com> on 2009/09/24 18:02:10 UTC

Pom Parent Version Properties

Hi All,

I have multimodule project so i defined a root pom which has entry like
<project>
    <modelVersion>4.0.0</modelVersion>
  <groupId>Admin</groupId>
  <artifactId>ProjetA</artifactId>
  <version>${releaseNumber}</version>
.....
....
<modules>
 <module>my-modA</module>
<module>my-modB</module>
<module>my-modC</module>
<module>my-modD</module>

then in child pom i refer my pom like

<project>
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>Admin</groupId>
        <artifactId>ProjectA</artifactId>
        <version>${releaseNumber}</version>
        <relativePath>${basedir}/../pom.xml</relativePath>
    </parent>


now when i run mvn -DreleaseNumber="55.0.0.0" clean install from the root
level everything works fine, it is parsing the ${releaseNumber}, but when i
just want to compile only my-modD its not working,${releaseNumber} is
notbeing parsed ie.  if i execute the same mvn command from the my-modD
folder directly its giving me an Error like


Downloading:
http://repo1.maven.org/maven2/Admin/ProjectA/${releaseNumber}/ProjectA-${releaseNumber}.pom
[DEBUG] Unable to locate resource in repository
org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate
resource in repository
        at
org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:139)
        at
org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
        at
org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
        at
org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:546)
        at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:427)
        at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:382)
        at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
        at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)

:::::::::::::::::::::::::::::::
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: Admin
ArtifactId: ProjectA
Version: ${releaseNumber}

Reason: Unable to download the artifact from any repository

  Admin:ProjectA:pom:${releaseNumber}

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)



Is there any other ways to pass this version as a parameter or it has to be
hardcoded??

Please help

Re: Pom Parent Version Properties

Posted by Albert Kurucz <al...@gmail.com>.
It looks like some of the stuff is outdated on that "best practice" document.
Maybe it was OK with Maven1.

Use it only if <sanity>insane</sanity>
(this is property of:
http://repo2.maven.org/maven2/org/apache/derby/derby-project/10.5.3.0/derby-project-10.5.3.0.pom)


On Tue, Sep 29, 2009 at 4:18 PM, paulv <Vo...@principal.com> wrote:
>
>
>
> Stephen Connolly-2 wrote:
>>
>> 2009/9/24 Jan <ra...@gmail.com>:
>>> Hi All,
>>>
>>> I have multimodule project so i defined a root pom which has entry like
>>> <project>
>>>    <modelVersion>4.0.0</modelVersion>
>>>  <groupId>Admin</groupId>
>>>  <artifactId>ProjetA</artifactId>
>>>  <version>${releaseNumber}</version>
>>> .....
>>> ....
>>> <modules>
>>>  <module>my-modA</module>
>>> <module>my-modB</module>
>>> <module>my-modC</module>
>>> <module>my-modD</module>
>>>
>>> then in child pom i refer my pom like
>>>
>>> <project>
>>>    <modelVersion>4.0.0</modelVersion>
>>>    <parent>
>>>        <groupId>Admin</groupId>
>>>        <artifactId>ProjectA</artifactId>
>>>        <version>${releaseNumber}</version>
>>>        <relativePath>${basedir}/../pom.xml</relativePath>
>>>    </parent>
>>>
>>>
>>> now when i run mvn -DreleaseNumber="55.0.0.0" clean install from the root
>>> level everything works fine,
>>
>> everything working fine is a bug. i.e. property substitution should
>> not be allowed in /project/parent/(groupId|artifactId|version) or in
>> /project/(groupId|artifactId|version)
>>
>
> Could you clarify?  Are you against the Application Version concept on this
> page:
> http://docs.codehaus.org/display/MAVEN/best+practices+-+version+management+in+multi+project+bu
> Is this no longer a "best practice"?
>
> Thanks,
> Paul
> --
> View this message in context: http://www.nabble.com/Pom-Parent-Version-Properties-tp25597937p25671120.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Pom Parent Version Properties

Posted by paulv <Vo...@principal.com>.


Stephen Connolly-2 wrote:
> 
> 2009/9/24 Jan <ra...@gmail.com>:
>> Hi All,
>>
>> I have multimodule project so i defined a root pom which has entry like
>> <project>
>>    <modelVersion>4.0.0</modelVersion>
>>  <groupId>Admin</groupId>
>>  <artifactId>ProjetA</artifactId>
>>  <version>${releaseNumber}</version>
>> .....
>> ....
>> <modules>
>>  <module>my-modA</module>
>> <module>my-modB</module>
>> <module>my-modC</module>
>> <module>my-modD</module>
>>
>> then in child pom i refer my pom like
>>
>> <project>
>>    <modelVersion>4.0.0</modelVersion>
>>    <parent>
>>        <groupId>Admin</groupId>
>>        <artifactId>ProjectA</artifactId>
>>        <version>${releaseNumber}</version>
>>        <relativePath>${basedir}/../pom.xml</relativePath>
>>    </parent>
>>
>>
>> now when i run mvn -DreleaseNumber="55.0.0.0" clean install from the root
>> level everything works fine,
> 
> everything working fine is a bug. i.e. property substitution should
> not be allowed in /project/parent/(groupId|artifactId|version) or in
> /project/(groupId|artifactId|version)
> 

Could you clarify?  Are you against the Application Version concept on this
page:
http://docs.codehaus.org/display/MAVEN/best+practices+-+version+management+in+multi+project+bu
Is this no longer a "best practice"?

Thanks,
Paul
-- 
View this message in context: http://www.nabble.com/Pom-Parent-Version-Properties-tp25597937p25671120.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Pom Parent Version Properties

Posted by Stephen Connolly <st...@gmail.com>.
functions as designed

Sent from my [rhymes with tryPod] ;-)

On 24 Sep 2009, at 18:28, Albert Kurucz <al...@gmail.com> wrote:

> Stephen, http://www.abbreviations.com/FAD ?
>
>
> On Thu, Sep 24, 2009 at 12:02 PM, Lacoste, Dana (TSG Software San
> Diego) <da...@hp.com> wrote:
>> This came up not three weeks ago.
>>
>> What most of us do to get around this is to use something else
>> to modify the pom.xml content before running maven.
>>
>> Personally, I use ant and xmltask.
>>
>> Why is it happening in an 'official' pom?  Because almost EVERY
>> user has a problem with this and we're all suffering, so I'm not
>> surprised that someone 'official' ran into it as well.
>>
>> So I can see at least two possibilities:
>> 1 - maven really IS expanding properties in the parent, for some
>> version of maven as used by the derby developers
>>
>> 2 - the "unmodified" pom got published with derby, rather than
>> the one that had been modified before maven was run.
>>
>> Either way, in my opinion it's definitely the single most
>> annoying thing with maven: the "<version>" field is interpreted
>> in different ways for every instance (sometimes it allows
>> variables, sometimes it doesn't: sometimes it allows ranges,
>> sometimes it doesn't, etc.)
>>
>> Dana Lacoste
>>
>> -----Original Message-----
>> From: Albert Kurucz [mailto:albert.kurucz@gmail.com]
>> Sent: Thursday, September 24, 2009 9:58 AM
>> To: Maven Users List
>> Subject: Re: Pom Parent Version Properties
>>
>> Is property substitution really forbidden in
>> /project/parent/(groupId|artifactId|version)?
>> If yes, how is it possible to see that on this Maven Central project?
>> http://repo2.maven.org/maven2/org/apache/derby/derby/10.5.3.0/derby-10.5.3.0.pom
>>
>> Is property substitution really forbidden in
>> /project/(groupId|artifactId|version)?
>> If yes, how is it possible to see that on this Maven Central project?
>> http://repo2.maven.org/maven2/org/apache/derby/derby-project/10.5.3.0/derby-project-10.5.3.0.pom
>>
>> Project's POM files may not getting verified for this criteria by the
>> maintainer of Maven Central?
>> Too bad!
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: Pom Parent Version Properties

Posted by Albert Kurucz <al...@gmail.com>.
Stephen, http://www.abbreviations.com/FAD ?


On Thu, Sep 24, 2009 at 12:02 PM, Lacoste, Dana (TSG Software San
Diego) <da...@hp.com> wrote:
> This came up not three weeks ago.
>
> What most of us do to get around this is to use something else
> to modify the pom.xml content before running maven.
>
> Personally, I use ant and xmltask.
>
> Why is it happening in an 'official' pom?  Because almost EVERY
> user has a problem with this and we're all suffering, so I'm not
> surprised that someone 'official' ran into it as well.
>
> So I can see at least two possibilities:
> 1 - maven really IS expanding properties in the parent, for some
> version of maven as used by the derby developers
>
> 2 - the "unmodified" pom got published with derby, rather than
> the one that had been modified before maven was run.
>
> Either way, in my opinion it's definitely the single most
> annoying thing with maven: the "<version>" field is interpreted
> in different ways for every instance (sometimes it allows
> variables, sometimes it doesn't: sometimes it allows ranges,
> sometimes it doesn't, etc.)
>
> Dana Lacoste
>
> -----Original Message-----
> From: Albert Kurucz [mailto:albert.kurucz@gmail.com]
> Sent: Thursday, September 24, 2009 9:58 AM
> To: Maven Users List
> Subject: Re: Pom Parent Version Properties
>
> Is property substitution really forbidden in
> /project/parent/(groupId|artifactId|version)?
> If yes, how is it possible to see that on this Maven Central project?
> http://repo2.maven.org/maven2/org/apache/derby/derby/10.5.3.0/derby-10.5.3.0.pom
>
> Is property substitution really forbidden in
> /project/(groupId|artifactId|version)?
> If yes, how is it possible to see that on this Maven Central project?
> http://repo2.maven.org/maven2/org/apache/derby/derby-project/10.5.3.0/derby-project-10.5.3.0.pom
>
> Project's POM files may not getting verified for this criteria by the
> maintainer of Maven Central?
> Too bad!
>

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


RE: Pom Parent Version Properties

Posted by "Lacoste, Dana (TSG Software San Diego)" <da...@hp.com>.
This came up not three weeks ago.

What most of us do to get around this is to use something else
to modify the pom.xml content before running maven.

Personally, I use ant and xmltask.

Why is it happening in an 'official' pom?  Because almost EVERY
user has a problem with this and we're all suffering, so I'm not
surprised that someone 'official' ran into it as well.

So I can see at least two possibilities:
1 - maven really IS expanding properties in the parent, for some
version of maven as used by the derby developers

2 - the "unmodified" pom got published with derby, rather than
the one that had been modified before maven was run.

Either way, in my opinion it's definitely the single most
annoying thing with maven: the "<version>" field is interpreted
in different ways for every instance (sometimes it allows
variables, sometimes it doesn't: sometimes it allows ranges,
sometimes it doesn't, etc.)

Dana Lacoste

-----Original Message-----
From: Albert Kurucz [mailto:albert.kurucz@gmail.com] 
Sent: Thursday, September 24, 2009 9:58 AM
To: Maven Users List
Subject: Re: Pom Parent Version Properties

Is property substitution really forbidden in
/project/parent/(groupId|artifactId|version)?
If yes, how is it possible to see that on this Maven Central project?
http://repo2.maven.org/maven2/org/apache/derby/derby/10.5.3.0/derby-10.5.3.0.pom

Is property substitution really forbidden in
/project/(groupId|artifactId|version)?
If yes, how is it possible to see that on this Maven Central project?
http://repo2.maven.org/maven2/org/apache/derby/derby-project/10.5.3.0/derby-project-10.5.3.0.pom

Project's POM files may not getting verified for this criteria by the
maintainer of Maven Central?
Too bad!

Re: Pom Parent Version Properties

Posted by Albert Kurucz <al...@gmail.com>.
Is property substitution really forbidden in
/project/parent/(groupId|artifactId|version)?
If yes, how is it possible to see that on this Maven Central project?
http://repo2.maven.org/maven2/org/apache/derby/derby/10.5.3.0/derby-10.5.3.0.pom

Is property substitution really forbidden in
/project/(groupId|artifactId|version)?
If yes, how is it possible to see that on this Maven Central project?
http://repo2.maven.org/maven2/org/apache/derby/derby-project/10.5.3.0/derby-project-10.5.3.0.pom

Project's POM files may not getting verified for this criteria by the
maintainer of Maven Central?
Too bad!

On Thu, Sep 24, 2009 at 11:27 AM, Stephen Connolly
<st...@gmail.com> wrote:
> 2009/9/24 Jan <ra...@gmail.com>:
>> Hi All,
>>
>> I have multimodule project so i defined a root pom which has entry like
>> <project>
>>    <modelVersion>4.0.0</modelVersion>
>>  <groupId>Admin</groupId>
>>  <artifactId>ProjetA</artifactId>
>>  <version>${releaseNumber}</version>
>> .....
>> ....
>> <modules>
>>  <module>my-modA</module>
>> <module>my-modB</module>
>> <module>my-modC</module>
>> <module>my-modD</module>
>>
>> then in child pom i refer my pom like
>>
>> <project>
>>    <modelVersion>4.0.0</modelVersion>
>>    <parent>
>>        <groupId>Admin</groupId>
>>        <artifactId>ProjectA</artifactId>
>>        <version>${releaseNumber}</version>
>>        <relativePath>${basedir}/../pom.xml</relativePath>
>>    </parent>
>>
>>
>> now when i run mvn -DreleaseNumber="55.0.0.0" clean install from the root
>> level everything works fine,
>
> everything working fine is a bug. i.e. property substitution should
> not be allowed in /project/parent/(groupId|artifactId|version) or in
> /project/(groupId|artifactId|version)
>
>> it is parsing the ${releaseNumber}, but when i
>> just want to compile only my-modD its not working,${releaseNumber} is
>> notbeing parsed ie.  if i execute the same mvn command from the my-modD
>> folder directly its giving me an Error like
>>
>>
>
> This is F.A.D.
>
>> Downloading:
>> http://repo1.maven.org/maven2/Admin/ProjectA/${releaseNumber}/ProjectA-${releaseNumber}.pom
>> [DEBUG] Unable to locate resource in repository
>> org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate
>> resource in repository
>>        at
>> org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:139)
>>        at
>> org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
>>        at
>> org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
>>        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
>>        at
>> org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:546)
>>        at
>> org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:427)
>>        at
>> org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:382)
>>        at
>> org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
>>        at
>> org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
>>
>> :::::::::::::::::::::::::::::::
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] FATAL ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Failed to resolve artifact.
>>
>> GroupId: Admin
>> ArtifactId: ProjectA
>> Version: ${releaseNumber}
>>
>> Reason: Unable to download the artifact from any repository
>>
>>  Admin:ProjectA:pom:${releaseNumber}
>>
>> from the specified remote repositories:
>>  central (http://repo1.maven.org/maven2)
>>
>>
>>
>> Is there any other ways to pass this version as a parameter or it has to be
>> hardcoded??
>
> hardcoded.
>
>>
>> Please help
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Pom Parent Version Properties

Posted by Stephen Connolly <st...@gmail.com>.
2009/9/24 Jan <ra...@gmail.com>:
> Hi All,
>
> I have multimodule project so i defined a root pom which has entry like
> <project>
>    <modelVersion>4.0.0</modelVersion>
>  <groupId>Admin</groupId>
>  <artifactId>ProjetA</artifactId>
>  <version>${releaseNumber}</version>
> .....
> ....
> <modules>
>  <module>my-modA</module>
> <module>my-modB</module>
> <module>my-modC</module>
> <module>my-modD</module>
>
> then in child pom i refer my pom like
>
> <project>
>    <modelVersion>4.0.0</modelVersion>
>    <parent>
>        <groupId>Admin</groupId>
>        <artifactId>ProjectA</artifactId>
>        <version>${releaseNumber}</version>
>        <relativePath>${basedir}/../pom.xml</relativePath>
>    </parent>
>
>
> now when i run mvn -DreleaseNumber="55.0.0.0" clean install from the root
> level everything works fine,

everything working fine is a bug. i.e. property substitution should
not be allowed in /project/parent/(groupId|artifactId|version) or in
/project/(groupId|artifactId|version)

> it is parsing the ${releaseNumber}, but when i
> just want to compile only my-modD its not working,${releaseNumber} is
> notbeing parsed ie.  if i execute the same mvn command from the my-modD
> folder directly its giving me an Error like
>
>

This is F.A.D.

> Downloading:
> http://repo1.maven.org/maven2/Admin/ProjectA/${releaseNumber}/ProjectA-${releaseNumber}.pom
> [DEBUG] Unable to locate resource in repository
> org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate
> resource in repository
>        at
> org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:139)
>        at
> org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
>        at
> org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
>        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
>        at
> org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:546)
>        at
> org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:427)
>        at
> org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:382)
>        at
> org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
>        at
> org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
>
> :::::::::::::::::::::::::::::::
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> GroupId: Admin
> ArtifactId: ProjectA
> Version: ${releaseNumber}
>
> Reason: Unable to download the artifact from any repository
>
>  Admin:ProjectA:pom:${releaseNumber}
>
> from the specified remote repositories:
>  central (http://repo1.maven.org/maven2)
>
>
>
> Is there any other ways to pass this version as a parameter or it has to be
> hardcoded??

hardcoded.

>
> Please help
>

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