You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by laredotornado-3 <la...@gmail.com> on 2013/08/20 19:53:43 UTC

Any way to generically specify a release version in a child POM when using the Maven release plugin?

Hi,

I'm using Maven 3.0.3.  I have a multi-module project and want to use the
Maven release plugin (through Jenkins).  When running release:prepare, the
process dies with the error

	Executing Maven:  -B -f /scratch/jenkins/workspace/subco/parent/pom.xml
-amd -pl org.mainco.subco:childModuleA -DdevelopmentVersion=38.0.1-SNAPSHOT
-DreleaseVersion=38.0.0 -Dusername=myuser -Dpassword=********* -P prod -P
cloudbees -DskipTests -Dresume=false -DdryRun=true release:prepare
	…
	message : Failed to execute goal
org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on
project childModuleA: Can't release project due to non released dependencies
:
	    org.mainco.subco:childModuleB:jar:38.0.0-SNAPSHOT:compile
	    org.mainco.subco:parent:pom:38.0.0-SNAPSHOT


Is there another way I can write the child dependency so that a release
version will be used?  I could hard code things but then I would have to go
and update all my child poms every time I want to use the Maven release
plugin, which seems to defeat the purpose.

The problematic child module (similar to others) is setup like so …

        <artifactId>childModuleA</artifactId>
        <packaging>jar</packaging>
		...
        <parent>
                <artifactId>parent</artifactId>
                <groupId>org.mainco.subco</groupId>
                <version>38.0.0-SNAPSHOT</version>
        </parent>
		...
        <dependencies>
			...
                <dependency>
                        <groupId>org.mainco.subco</groupId>
                        <artifactId>childModuleB</artifactId>
                        <version>${project.version}</version>
                </dependency>



Thanks, - Dave



--
View this message in context: http://maven.40175.n5.nabble.com/Any-way-to-generically-specify-a-release-version-in-a-child-POM-when-using-the-Maven-release-plugin-tp5768328.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: Any way to generically specify a release version in a child POM when using the Maven release plugin?

Posted by Brett Vanderveen <br...@gfs.com>.
Ignore my last email. <inserts foot in mouth>
It would help if I had the version entry on the parent pom.
Example:
<dependency>

<groupId>org.mainco.subco</groupId>
<artifactId>childModuleB</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>

</dependency>

*Brett VanderVeen* | brett.vanderveen@gfs.com

*Gordon Food Service®* | IS Transportation | *www.gfs.com*

P 616-717-6042 | C 630-310-0172

Street: 1300 Gezon Parkway SW | Wyoming, MI 49509-9300

Mail: Mail Code 12003 | PO Box 1787 | Grand Rapids, MI 49501-1787


On Tue, Aug 20, 2013 at 4:18 PM, Brett Vanderveen
<br...@gfs.com>wrote:

> Hey Ziga,
> Is it possible to do the same thing for test-jar's?
> It looks like maven still wants the version.
> Is it OK just just use ${project.version} in that case?
>
> *Brett VanderVeen* | brett.vanderveen@gfs.com
>
> *Gordon Food Service®* | IS Transportation | *www.gfs.com*
>
> P 616-717-6042 | C 630-310-0172
>
> Street: 1300 Gezon Parkway SW | Wyoming, MI 49509-9300
>
> Mail: Mail Code 12003 | PO Box 1787 | Grand Rapids, MI 49501-1787
>
>
> On Tue, Aug 20, 2013 at 2:18 PM, Ziga GREGORIC <zi...@gmail.com>wrote:
>
>> Remove <version>${project.version}</version> from child pom
>> and add whole
>>  <dependency>
>>       <groupId>org.mainco.subco</groupId>
>>       <artifactId>childModuleB</artifactId>
>>       <version>${project.version}</version>
>>  </dependency>
>> to main (direct parent, I guess) pom, inside <dependencyManagement>
>> element.
>>
>> Regards,
>> Ziga Gregoric
>>
>>
>>
>>
>>
>> On Tue, Aug 20, 2013 at 7:53 PM, laredotornado-3 <laredotornado@gmail.com
>> >wrote:
>>
>> > Hi,
>> >
>> > I'm using Maven 3.0.3.  I have a multi-module project and want to use
>> the
>> > Maven release plugin (through Jenkins).  When running release:prepare,
>> the
>> > process dies with the error
>> >
>> >         Executing Maven:  -B -f
>> > /scratch/jenkins/workspace/subco/parent/pom.xml
>> > -amd -pl org.mainco.subco:childModuleA
>> -DdevelopmentVersion=38.0.1-SNAPSHOT
>> > -DreleaseVersion=38.0.0 -Dusername=myuser -Dpassword=********* -P prod
>> -P
>> > cloudbees -DskipTests -Dresume=false -DdryRun=true release:prepare
>> >         …
>> >         message : Failed to execute goal
>> > org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli)
>> on
>> > project childModuleA: Can't release project due to non released
>> > dependencies
>> > :
>> >             org.mainco.subco:childModuleB:jar:38.0.0-SNAPSHOT:compile
>> >             org.mainco.subco:parent:pom:38.0.0-SNAPSHOT
>> >
>> >
>> > Is there another way I can write the child dependency so that a release
>> > version will be used?  I could hard code things but then I would have
>> to go
>> > and update all my child poms every time I want to use the Maven release
>> > plugin, which seems to defeat the purpose.
>> >
>> > The problematic child module (similar to others) is setup like so …
>> >
>> >         <artifactId>childModuleA</artifactId>
>> >         <packaging>jar</packaging>
>> >                 ...
>> >         <parent>
>> >                 <artifactId>parent</artifactId>
>> >                 <groupId>org.mainco.subco</groupId>
>> >                 <version>38.0.0-SNAPSHOT</version>
>> >         </parent>
>> >                 ...
>> >         <dependencies>
>> >                         ...
>> >                 <dependency>
>> >                         <groupId>org.mainco.subco</groupId>
>> >                         <artifactId>childModuleB</artifactId>
>> >                         <version>${project.version}</version>
>> >                 </dependency>
>> >
>> >
>> >
>> > Thanks, - Dave
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://maven.40175.n5.nabble.com/Any-way-to-generically-specify-a-release-version-in-a-child-POM-when-using-the-Maven-release-plugin-tp5768328.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: Any way to generically specify a release version in a child POM when using the Maven release plugin?

Posted by Brett Vanderveen <br...@gfs.com>.
Hey Ziga,
Is it possible to do the same thing for test-jar's?
It looks like maven still wants the version.
Is it OK just just use ${project.version} in that case?

*Brett VanderVeen* | brett.vanderveen@gfs.com

*Gordon Food Service®* | IS Transportation | *www.gfs.com*

P 616-717-6042 | C 630-310-0172

Street: 1300 Gezon Parkway SW | Wyoming, MI 49509-9300

Mail: Mail Code 12003 | PO Box 1787 | Grand Rapids, MI 49501-1787


On Tue, Aug 20, 2013 at 2:18 PM, Ziga GREGORIC <zi...@gmail.com>wrote:

> Remove <version>${project.version}</version> from child pom
> and add whole
>  <dependency>
>       <groupId>org.mainco.subco</groupId>
>       <artifactId>childModuleB</artifactId>
>       <version>${project.version}</version>
>  </dependency>
> to main (direct parent, I guess) pom, inside <dependencyManagement>
> element.
>
> Regards,
> Ziga Gregoric
>
>
>
>
>
> On Tue, Aug 20, 2013 at 7:53 PM, laredotornado-3 <laredotornado@gmail.com
> >wrote:
>
> > Hi,
> >
> > I'm using Maven 3.0.3.  I have a multi-module project and want to use the
> > Maven release plugin (through Jenkins).  When running release:prepare,
> the
> > process dies with the error
> >
> >         Executing Maven:  -B -f
> > /scratch/jenkins/workspace/subco/parent/pom.xml
> > -amd -pl org.mainco.subco:childModuleA
> -DdevelopmentVersion=38.0.1-SNAPSHOT
> > -DreleaseVersion=38.0.0 -Dusername=myuser -Dpassword=********* -P prod -P
> > cloudbees -DskipTests -Dresume=false -DdryRun=true release:prepare
> >         …
> >         message : Failed to execute goal
> > org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli)
> on
> > project childModuleA: Can't release project due to non released
> > dependencies
> > :
> >             org.mainco.subco:childModuleB:jar:38.0.0-SNAPSHOT:compile
> >             org.mainco.subco:parent:pom:38.0.0-SNAPSHOT
> >
> >
> > Is there another way I can write the child dependency so that a release
> > version will be used?  I could hard code things but then I would have to
> go
> > and update all my child poms every time I want to use the Maven release
> > plugin, which seems to defeat the purpose.
> >
> > The problematic child module (similar to others) is setup like so …
> >
> >         <artifactId>childModuleA</artifactId>
> >         <packaging>jar</packaging>
> >                 ...
> >         <parent>
> >                 <artifactId>parent</artifactId>
> >                 <groupId>org.mainco.subco</groupId>
> >                 <version>38.0.0-SNAPSHOT</version>
> >         </parent>
> >                 ...
> >         <dependencies>
> >                         ...
> >                 <dependency>
> >                         <groupId>org.mainco.subco</groupId>
> >                         <artifactId>childModuleB</artifactId>
> >                         <version>${project.version}</version>
> >                 </dependency>
> >
> >
> >
> > Thanks, - Dave
> >
> >
> >
> > --
> > View this message in context:
> >
> http://maven.40175.n5.nabble.com/Any-way-to-generically-specify-a-release-version-in-a-child-POM-when-using-the-Maven-release-plugin-tp5768328.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: Any way to generically specify a release version in a child POM when using the Maven release plugin?

Posted by Ziga GREGORIC <zi...@gmail.com>.
Remove <version>${project.version}</version> from child pom
and add whole
 <dependency>
      <groupId>org.mainco.subco</groupId>
      <artifactId>childModuleB</artifactId>
      <version>${project.version}</version>
 </dependency>
to main (direct parent, I guess) pom, inside <dependencyManagement>
element.

Regards,
Ziga Gregoric





On Tue, Aug 20, 2013 at 7:53 PM, laredotornado-3 <la...@gmail.com>wrote:

> Hi,
>
> I'm using Maven 3.0.3.  I have a multi-module project and want to use the
> Maven release plugin (through Jenkins).  When running release:prepare, the
> process dies with the error
>
>         Executing Maven:  -B -f
> /scratch/jenkins/workspace/subco/parent/pom.xml
> -amd -pl org.mainco.subco:childModuleA -DdevelopmentVersion=38.0.1-SNAPSHOT
> -DreleaseVersion=38.0.0 -Dusername=myuser -Dpassword=********* -P prod -P
> cloudbees -DskipTests -Dresume=false -DdryRun=true release:prepare
>         …
>         message : Failed to execute goal
> org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on
> project childModuleA: Can't release project due to non released
> dependencies
> :
>             org.mainco.subco:childModuleB:jar:38.0.0-SNAPSHOT:compile
>             org.mainco.subco:parent:pom:38.0.0-SNAPSHOT
>
>
> Is there another way I can write the child dependency so that a release
> version will be used?  I could hard code things but then I would have to go
> and update all my child poms every time I want to use the Maven release
> plugin, which seems to defeat the purpose.
>
> The problematic child module (similar to others) is setup like so …
>
>         <artifactId>childModuleA</artifactId>
>         <packaging>jar</packaging>
>                 ...
>         <parent>
>                 <artifactId>parent</artifactId>
>                 <groupId>org.mainco.subco</groupId>
>                 <version>38.0.0-SNAPSHOT</version>
>         </parent>
>                 ...
>         <dependencies>
>                         ...
>                 <dependency>
>                         <groupId>org.mainco.subco</groupId>
>                         <artifactId>childModuleB</artifactId>
>                         <version>${project.version}</version>
>                 </dependency>
>
>
>
> Thanks, - Dave
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Any-way-to-generically-specify-a-release-version-in-a-child-POM-when-using-the-Maven-release-plugin-tp5768328.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: Any way to generically specify a release version in a child POM when using the Maven release plugin?

Posted by Ziga GREGORIC <zi...@gmail.com>.
@Bret, as you've figured out already, it works for non-jars. In case of a
war, you just add artifacts type (<type>war</type>). :-)

@Baptiste, yes, for the release itself. I find it even more practical to
have configuration for maven-release-plugin
<autoVersionSubmodules>true</autoVersionSubmodules> in project's pom.

Regards,
Ziga Gregoric




On Tue, Aug 20, 2013 at 10:44 PM, Baptiste Mathus <ml...@batmat.net> wrote:

> Would need to check but maybe try adding -DautoVersionSubmodules=true so
> that all modules get released with that version.
>
> My 2 cents.
> Le 20 août 2013 19:54, "laredotornado-3" <la...@gmail.com> a
> écrit :
>
> > Hi,
> >
> > I'm using Maven 3.0.3.  I have a multi-module project and want to use the
> > Maven release plugin (through Jenkins).  When running release:prepare,
> the
> > process dies with the error
> >
> >         Executing Maven:  -B -f
> > /scratch/jenkins/workspace/subco/parent/pom.xml
> > -amd -pl org.mainco.subco:childModuleA
> -DdevelopmentVersion=38.0.1-SNAPSHOT
> > -DreleaseVersion=38.0.0 -Dusername=myuser -Dpassword=********* -P prod -P
> > cloudbees -DskipTests -Dresume=false -DdryRun=true release:prepare
> >         …
> >         message : Failed to execute goal
> > org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli)
> on
> > project childModuleA: Can't release project due to non released
> > dependencies
> > :
> >             org.mainco.subco:childModuleB:jar:38.0.0-SNAPSHOT:compile
> >             org.mainco.subco:parent:pom:38.0.0-SNAPSHOT
> >
> >
> > Is there another way I can write the child dependency so that a release
> > version will be used?  I could hard code things but then I would have to
> go
> > and update all my child poms every time I want to use the Maven release
> > plugin, which seems to defeat the purpose.
> >
> > The problematic child module (similar to others) is setup like so …
> >
> >         <artifactId>childModuleA</artifactId>
> >         <packaging>jar</packaging>
> >                 ...
> >         <parent>
> >                 <artifactId>parent</artifactId>
> >                 <groupId>org.mainco.subco</groupId>
> >                 <version>38.0.0-SNAPSHOT</version>
> >         </parent>
> >                 ...
> >         <dependencies>
> >                         ...
> >                 <dependency>
> >                         <groupId>org.mainco.subco</groupId>
> >                         <artifactId>childModuleB</artifactId>
> >                         <version>${project.version}</version>
> >                 </dependency>
> >
> >
> >
> > Thanks, - Dave
> >
> >
> >
> > --
> > View this message in context:
> >
> http://maven.40175.n5.nabble.com/Any-way-to-generically-specify-a-release-version-in-a-child-POM-when-using-the-Maven-release-plugin-tp5768328.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: Any way to generically specify a release version in a child POM when using the Maven release plugin?

Posted by Baptiste Mathus <ml...@batmat.net>.
Would need to check but maybe try adding -DautoVersionSubmodules=true so
that all modules get released with that version.

My 2 cents.
Le 20 août 2013 19:54, "laredotornado-3" <la...@gmail.com> a écrit :

> Hi,
>
> I'm using Maven 3.0.3.  I have a multi-module project and want to use the
> Maven release plugin (through Jenkins).  When running release:prepare, the
> process dies with the error
>
>         Executing Maven:  -B -f
> /scratch/jenkins/workspace/subco/parent/pom.xml
> -amd -pl org.mainco.subco:childModuleA -DdevelopmentVersion=38.0.1-SNAPSHOT
> -DreleaseVersion=38.0.0 -Dusername=myuser -Dpassword=********* -P prod -P
> cloudbees -DskipTests -Dresume=false -DdryRun=true release:prepare
>         …
>         message : Failed to execute goal
> org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on
> project childModuleA: Can't release project due to non released
> dependencies
> :
>             org.mainco.subco:childModuleB:jar:38.0.0-SNAPSHOT:compile
>             org.mainco.subco:parent:pom:38.0.0-SNAPSHOT
>
>
> Is there another way I can write the child dependency so that a release
> version will be used?  I could hard code things but then I would have to go
> and update all my child poms every time I want to use the Maven release
> plugin, which seems to defeat the purpose.
>
> The problematic child module (similar to others) is setup like so …
>
>         <artifactId>childModuleA</artifactId>
>         <packaging>jar</packaging>
>                 ...
>         <parent>
>                 <artifactId>parent</artifactId>
>                 <groupId>org.mainco.subco</groupId>
>                 <version>38.0.0-SNAPSHOT</version>
>         </parent>
>                 ...
>         <dependencies>
>                         ...
>                 <dependency>
>                         <groupId>org.mainco.subco</groupId>
>                         <artifactId>childModuleB</artifactId>
>                         <version>${project.version}</version>
>                 </dependency>
>
>
>
> Thanks, - Dave
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Any-way-to-generically-specify-a-release-version-in-a-child-POM-when-using-the-Maven-release-plugin-tp5768328.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
>
>