You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Eigenbrodt <ma...@googlemail.com> on 2009/03/24 10:16:03 UTC

Release plugin and multimodule interdependent childs

This may be a beginner question,  but I haven't found any hints..
I've got a project that contains a servlet and an ejb. The Servlet depends
on the ejb. I've trouble releasing that as complete project.

My directory Layout is like:

pom.xml <- package type pom
   servlet
       pom.xml
  ejb
       pom.xml

the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom don't
specify a version (inherit them).
The Servlet defines a dependecy on the ejb without specifing a version.
The dependencyMangement section from the parent pom contains:
 <dependencies>
    <dependency>
      <groupId>myGroup<groupId>
      <artifactId>ejb<artifactId>
      <version>${project.version}</version>
    </dependency>

If I try release:prepare the build fails with "Failed to resolve artifacts:
myGroup:ejb:1.1

I understand why this happens but is there a obvious solution? How do you
release multimodule projects with interdependent childs?

Best regards,

Martin

RE: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Todd,

Todd Thiessen wrote at Dienstag, 24. März 2009 15:03:

> I was part of that discussion but I don't consider myself a Maven expert
> yet. However I did go away from the conversation and made a very simple
> maven multi-module project and ran a release on it. I ensured the project
> had dependencies between modules and the release worked without having to
> perform an install first and when using ${project.version}.
> 
> Can anyone definitively answer if this is the correct way to do it? Or is
> using the string directly the correct way?  Or is either way consider
> correct ;-).

IMHO either way is correct as long as you do not have to perform an explicit
install. Basically it depends on the time when Maven used the adjusted POMs
of parent and children, at what time the property is resolved and when the
depMgmt is applied. It seems, different versions of the release plugin and
Maven will work slightly different here.

- Jöärg


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


RE: Release plugin and multimodule interdependent childs

Posted by Todd Thiessen <th...@nortel.com>.
I was part of that discussion but I don't consider myself a Maven expert yet. However I did go away from the conversation and made a very simple maven multi-module project and ran a release on it. I ensured the project had dependencies between modules and the release worked without having to perform an install first and when using ${project.version}.

Can anyone definitively answer if this is the correct way to do it? Or is using the string directly the correct way?  Or is either way consider correct ;-).

---
Todd Thiessen
 

> -----Original Message-----
> From: Martin Höller [mailto:martin@xss.co.at] 
> Sent: Tuesday, March 24, 2009 9:49 AM
> To: Maven Users List
> Subject: Re: Release plugin and multimodule interdependent childs
> 
> On Tuesday 24 March 2009 Reinhard Nägele wrote:
> > I don't have a solution to your problem, but I would advice against 
> > putting the real version number instead of 
> ${project.version}. It is 
> > good practice to avoid such redundancy using 
> ${project.version}, even 
> > though the release plugin can deal with explicit versions. Using 
> > ${project.version} is also suggested by "The Definitive Guide"
> > 
> (http://www.sonatype.com/products/maven/documentation/book-defguide).
> 
> And in this thread [1] it was recommended to use the real 
> version instead of ${project.version}.
> 
> So what is the real truth?
> 
> - martin
> 
> PS: We are using the version string, having the release 
> plugin update it
>     without any problems here.
> 
> [1] http://www.nabble.com/forum/ViewPost.jtp?post=22340527&framed=y
> 

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


RE: Re: Release plugin and multimodule interdependent childs

Posted by Todd Thiessen <th...@nortel.com>.
> Actually this thread simply displays Todd's and my 
> disagreement (or at least different experiences) ;-)

No disagreement, just different experiences ;-). I wasn't using maving
back in the days of release plugin 2.0-beta-5 so I don't have nearly as
much experience as Jorg does.  Thus I would like someone to confirm my
finding that the release plugin still works as intended on a project
with dependecies between modules and using ${project.version}.

Perhaps we should take this question to the release-plugin dev list?

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


Re: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Martin Höller wrote at Dienstag, 24. März 2009 14:48:

> On Tuesday 24 March 2009 Reinhard Nägele wrote:
>> I don't have a solution to your problem, but I would advice against
>> putting the real version number instead of ${project.version}. It is
>> good practice to avoid such redundancy using ${project.version}, even
>> though the release plugin can deal with explicit versions. Using
>> ${project.version} is also suggested by "The Definitive Guide"
>> (http://www.sonatype.com/products/maven/documentation/book-defguide).
> 
> And in this thread [1] it was recommended to use the real version instead
> of ${project.version}.
> 
> So what is the real truth?
> 
> - martin
> 
> PS: We are using the version string, having the release plugin update it
>     without any problems here.
> 
> [1] http://www.nabble.com/forum/ViewPost.jtp?post=22340527&framed=y

Actually this thread simply displays Todd's and my disagreement (or at least
different experiences) ;-)

For the records: We originally used properties and it stopped working with
2.0-beta-5, not with 2.0-beta-6. However, at that time we used the
properties directly in the deps of the children and not in the depMgmt of
the parent. Additionally if you look at the resolved issues, there has been
a lot of work done regarding this.

Funny thing is that we use now for quite some time exactly the described
scenario of Martin, but with explicit versions in the depMgmt and it works
for us.

- Jörg


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


Re: Release plugin and multimodule interdependent childs

Posted by Martin Höller <ma...@xss.co.at>.
On Tuesday 24 March 2009 Reinhard Nägele wrote:
> I don't have a solution to your problem, but I would advice against
> putting the real version number instead of ${project.version}. It is
> good practice to avoid such redundancy using ${project.version}, even
> though the release plugin can deal with explicit versions. Using
> ${project.version} is also suggested by "The Definitive Guide"
> (http://www.sonatype.com/products/maven/documentation/book-defguide).

And in this thread [1] it was recommended to use the real version instead of 
${project.version}.

So what is the real truth?

- martin

PS: We are using the version string, having the release plugin update it
    without any problems here.

[1] http://www.nabble.com/forum/ViewPost.jtp?post=22340527&framed=y

RE: RE: Re: Release plugin and multimodule interdependent childs

Posted by Todd Thiessen <th...@nortel.com>.
> > 
> > It does support this with release 2.0-beta-8. I have not tried with 
> > the soon to be released 2.0-beta-9 snapshot but I am 
> willing to bet it 
> > is supported there to.
> 
> For me it stopped working somewhere with 2.0-beta-6. 
> Originally I used also the property approach.
> 
> - Jörg

Interesting. I wonder if this was a bug in 2.0-beta-6 or intended behaviour. My experience has been that using a property or the string directly doesn't make a difference. I have only used 2.0-beta-8 though.

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


RE: Re: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Todd Thiessen wrote at Dienstag, 24. März 2009 14:21:

> 
>> Hi Reinhard
>> 
>> Reinhard Nägele wrote at Dienstag, 24. März 2009 13:12:
>> 
>> > I don't have a solution to your problem, but I would advice against
>> > putting the real version number instead of
>> ${project.version}. It is
>> > good practice to avoid such redundancy using
>> ${project.version}, even
>> > though the release plugin can deal with explicit versions. Using
>> > ${project.version} is also suggested by "The Definitive Guide"
>> > 
>> (http://www.sonatype.com/products/maven/documentation/book-defguide).
>> 
>> ... and this scenario is no longer supported by newer release
>> plugin versions. Since the release plugin handles this, why
>> should you care?
>> 
>> - Jörg
> 
> It does support this with release 2.0-beta-8. I have not tried with the
> soon to be released 2.0-beta-9 snapshot but I am willing to bet it is
> supported there to.

For me it stopped working somewhere with 2.0-beta-6. Originally I used also
the property approach.

- Jörg


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


RE: Re: Release plugin and multimodule interdependent childs

Posted by Todd Thiessen <th...@nortel.com>.
> Hi Reinhard
> 
> Reinhard Nägele wrote at Dienstag, 24. März 2009 13:12:
> 
> > I don't have a solution to your problem, but I would advice against 
> > putting the real version number instead of 
> ${project.version}. It is 
> > good practice to avoid such redundancy using 
> ${project.version}, even 
> > though the release plugin can deal with explicit versions. Using 
> > ${project.version} is also suggested by "The Definitive Guide"
> > 
> (http://www.sonatype.com/products/maven/documentation/book-defguide).
> 
> ... and this scenario is no longer supported by newer release 
> plugin versions. Since the release plugin handles this, why 
> should you care?
> 
> - Jörg

It does support this with release 2.0-beta-8. I have not tried with the soon to be released 2.0-beta-9 snapshot but I am willing to bet it is supported there to. 

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


Re: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Reinhard

Reinhard Nägele wrote at Dienstag, 24. März 2009 13:12:

> I don't have a solution to your problem, but I would advice against
> putting the real version number instead of ${project.version}. It is
> good practice to avoid such redundancy using ${project.version}, even
> though the release plugin can deal with explicit versions. Using
> ${project.version} is also suggested by "The Definitive Guide"
> (http://www.sonatype.com/products/maven/documentation/book-defguide).

... and this scenario is no longer supported by newer release plugin
versions. Since the release plugin handles this, why should you care?

- Jörg


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


Re: Release plugin and multimodule interdependent childs

Posted by Martin Eigenbrodt <ma...@googlemail.com>.
Thank to all. I'll try the latest version of the release plugin against a
simple project setup as proposed.
I'm still l uncertain whether to use the property or hardcoded version...

2009/3/24 Todd Thiessen <th...@nortel.com>

> > Interesting. How should the plugin this without installing?
>
> I am not sure. I have not walked through the code to find out. The release
> plugin must put the target directory of dependant modules on its classpath
> so it can find those artifacts. But I have seen the release plugin fail in
> the same way you are seeing it and I couldn't explain it. The projects it
> was failing on were not a project I owned but were projects I simply made a
> checkout of and tried to do a build so there were likely some things going
> on there that the release plugin didn't like.  For instance I suspect if you
> have some generated code or if you have a module which uses something other
> than the target directory, the release plugin may not be able to find those
> artifacts.
>
> I am taking educated guesses though. I have not yet taken the time to
> figure this one out on my own (hard to find the time to figure out
> everything). I have been hoping that a more knowledgable release plugin dev
> would fill in some details here but I have not seen or found such a
> response.
>
> >
> >
> > > If all else fails, you could do that (ie: install first) although
> > > there have been a number of Maven users on this list who
> > have spoken
> > > against this approach.
> > >
> >
> > This is would mean I'd have to replace the SNAPSHOT Version
> > manually before the release to trigger the install. Maybe I
> > should try to add "install" to the preperartionGoals.
>
> Yes. Using the preperationGoals configuration was what I was referring to.
>
> Before you do that, however, I would recommend taking the time to create a
> very simple multi-module project to see the release plugin work without
> having to install dependant modules first. It does seem to work and there is
> likely something special about your project which is causing it to fail. If
> you do figure it out, please post it to this list.
>
> >
> >
> > >
> > > So why does the release plugin display a message indicating that an
> > > install should be done first? I don't know but would really
> > like to ;-).
> > >
> > > ---
> > > Todd Thiessen
> > >
> > >
> > > > -----Original Message-----
> > > > From: Reinhard Nägele [mailto:reinhard.naegele@mgm-tp.com]
> > > > Sent: Tuesday, March 24, 2009 8:13 AM
> > > > To: Maven Users List
> > > > Subject: Re: Release plugin and multimodule interdependent childs
> > > >
> > > > I don't have a solution to your problem, but I would
> > advice against
> > > > putting the real version number instead of
> > ${project.version}. It is
> > > > good practice to avoid such redundancy using ${project.version},
> > > > even though the release plugin can deal with explicit versions.
> > > > Using ${project.version} is also suggested by "The
> > Definitive Guide"
> > > >
> > (http://www.sonatype.com/products/maven/documentation/book-defguide).
> > > >
> > > > Reinhard
> > > >
> > > >
> > > > Martin Eigenbrodt schrieb:
> > > > > I've replaced ${project.version} with 1.1-SNAPSHOT. The
> > > > Release plugin
> > > > > replaces this with 1.1 during release:prepare and fails
> > > > with the same
> > > > > message.
> > > > > I think the release plugin should first trigger a install
> > > > on the ejb
> > > > > and then run the servlet target.
> > > > >
> > > > > 2009/3/24 Jörg Schaible <jo...@gmx.de>
> > > > >
> > > > >
> > > > >> Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:
> > > > >>
> > > > >>
> > > > >>> This may be a beginner question,  but I haven't found
> > any hints..
> > > > >>> I've got a project that contains a servlet and an ejb. The
> > > > >>> Servlet
> > > > >>>
> > > > >> depends
> > > > >>
> > > > >>> on the ejb. I've trouble releasing that as complete project.
> > > > >>>
> > > > >>> My directory Layout is like:
> > > > >>>
> > > > >>> pom.xml <- package type pom
> > > > >>>    servlet
> > > > >>>        pom.xml
> > > > >>>   ejb
> > > > >>>        pom.xml
> > > > >>>
> > > > >>> the parent pom has version 1.1-SNAPSHOT.  The Servlet
> > an ejb pom
> > > > >>> don't specify a version (inherit them).
> > > > >>> The Servlet defines a dependecy on the ejb without
> > > > specifing a version.
> > > > >>> The dependencyMangement section from the parent pom contains:
> > > > >>>  <dependencies>
> > > > >>>     <dependency>
> > > > >>>       <groupId>myGroup<groupId>
> > > > >>>       <artifactId>ejb<artifactId>
> > > > >>>       <version>${project.version}</version>
> > > > >>>     </dependency>
> > > > >>>
> > > > >>> If I try release:prepare the build fails with "Failed
> > to resolve
> > > > >>> artifacts: myGroup:ejb:1.1
> > > > >>>
> > > > >>> I understand why this happens but is there a obvious
> > > > solution? How
> > > > >>> do you release multimodule projects with
> > interdependent childs?
> > > > >>>
> > > > >> Do not use that property and write the corretc version.
> > > > The release
> > > > >> plugin will then handle it and adjust it automatically.
> > > > >>
> > > > >> - Jörg
> > > > >>
> > > > >>
> > > > >>
> > > >
> > --------------------------------------------------------------------
> > > > -
> > > > >> 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
> > > >
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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: Release plugin and multimodule interdependent childs

Posted by Todd Thiessen <th...@nortel.com>.
> Interesting. How should the plugin this without installing?

I am not sure. I have not walked through the code to find out. The release plugin must put the target directory of dependant modules on its classpath so it can find those artifacts. But I have seen the release plugin fail in the same way you are seeing it and I couldn't explain it. The projects it was failing on were not a project I owned but were projects I simply made a checkout of and tried to do a build so there were likely some things going on there that the release plugin didn't like.  For instance I suspect if you have some generated code or if you have a module which uses something other than the target directory, the release plugin may not be able to find those artifacts.

I am taking educated guesses though. I have not yet taken the time to figure this one out on my own (hard to find the time to figure out everything). I have been hoping that a more knowledgable release plugin dev would fill in some details here but I have not seen or found such a response.

> 
> 
> > If all else fails, you could do that (ie: install first) although 
> > there have been a number of Maven users on this list who 
> have spoken 
> > against this approach.
> >
> 
> This is would mean I'd have to replace the SNAPSHOT Version 
> manually before the release to trigger the install. Maybe I 
> should try to add "install" to the preperartionGoals.

Yes. Using the preperationGoals configuration was what I was referring to.

Before you do that, however, I would recommend taking the time to create a very simple multi-module project to see the release plugin work without having to install dependant modules first. It does seem to work and there is likely something special about your project which is causing it to fail. If you do figure it out, please post it to this list.

> 
> 
> >
> > So why does the release plugin display a message indicating that an 
> > install should be done first? I don't know but would really 
> like to ;-).
> >
> > ---
> > Todd Thiessen
> >
> >
> > > -----Original Message-----
> > > From: Reinhard Nägele [mailto:reinhard.naegele@mgm-tp.com]
> > > Sent: Tuesday, March 24, 2009 8:13 AM
> > > To: Maven Users List
> > > Subject: Re: Release plugin and multimodule interdependent childs
> > >
> > > I don't have a solution to your problem, but I would 
> advice against 
> > > putting the real version number instead of 
> ${project.version}. It is 
> > > good practice to avoid such redundancy using ${project.version}, 
> > > even though the release plugin can deal with explicit versions. 
> > > Using ${project.version} is also suggested by "The 
> Definitive Guide"
> > > 
> (http://www.sonatype.com/products/maven/documentation/book-defguide).
> > >
> > > Reinhard
> > >
> > >
> > > Martin Eigenbrodt schrieb:
> > > > I've replaced ${project.version} with 1.1-SNAPSHOT. The
> > > Release plugin
> > > > replaces this with 1.1 during release:prepare and fails
> > > with the same
> > > > message.
> > > > I think the release plugin should first trigger a install
> > > on the ejb
> > > > and then run the servlet target.
> > > >
> > > > 2009/3/24 Jörg Schaible <jo...@gmx.de>
> > > >
> > > >
> > > >> Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:
> > > >>
> > > >>
> > > >>> This may be a beginner question,  but I haven't found 
> any hints..
> > > >>> I've got a project that contains a servlet and an ejb. The 
> > > >>> Servlet
> > > >>>
> > > >> depends
> > > >>
> > > >>> on the ejb. I've trouble releasing that as complete project.
> > > >>>
> > > >>> My directory Layout is like:
> > > >>>
> > > >>> pom.xml <- package type pom
> > > >>>    servlet
> > > >>>        pom.xml
> > > >>>   ejb
> > > >>>        pom.xml
> > > >>>
> > > >>> the parent pom has version 1.1-SNAPSHOT.  The Servlet 
> an ejb pom 
> > > >>> don't specify a version (inherit them).
> > > >>> The Servlet defines a dependecy on the ejb without
> > > specifing a version.
> > > >>> The dependencyMangement section from the parent pom contains:
> > > >>>  <dependencies>
> > > >>>     <dependency>
> > > >>>       <groupId>myGroup<groupId>
> > > >>>       <artifactId>ejb<artifactId>
> > > >>>       <version>${project.version}</version>
> > > >>>     </dependency>
> > > >>>
> > > >>> If I try release:prepare the build fails with "Failed 
> to resolve
> > > >>> artifacts: myGroup:ejb:1.1
> > > >>>
> > > >>> I understand why this happens but is there a obvious
> > > solution? How
> > > >>> do you release multimodule projects with 
> interdependent childs?
> > > >>>
> > > >> Do not use that property and write the corretc version.
> > > The release
> > > >> plugin will then handle it and adjust it automatically.
> > > >>
> > > >> - Jörg
> > > >>
> > > >>
> > > >>
> > > 
> --------------------------------------------------------------------
> > > -
> > > >> 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
> > >
> > >
> >
> > 
> ---------------------------------------------------------------------
> > 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: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Martin,

Martin Eigenbrodt wrote at Dienstag, 24. März 2009 14:05:

> 2009/3/24 Todd Thiessen <th...@nortel.com>
> 
>> As far as my understanding goes, the release plugin "should" be able to
>> handle depenencies between modules without installing those modules to
>> your local repository. Oddly enough, the release plugin does display a
>> warning saying that an install should be performed first if you have this
>> situation.
>>
> Interesting. How should the plugin this without installing?

The release plugin uses the generated jars in the target directory
(therefore all the dependent artifacts that are part of this release have
to be in the reactor).

- Jörg


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


Re: Release plugin and multimodule interdependent childs

Posted by Martin Eigenbrodt <ma...@googlemail.com>.
2009/3/24 Todd Thiessen <th...@nortel.com>

> As far as my understanding goes, the release plugin "should" be able to
> handle depenencies between modules without installing those modules to your
> local repository. Oddly enough, the release plugin does display a warning
> saying that an install should be performed first if you have this situation.
>
Interesting. How should the plugin this without installing?


> If all else fails, you could do that (ie: install first) although there
> have been a number of Maven users on this list who have spoken against this
> approach.
>

This is would mean I'd have to replace the SNAPSHOT Version manually before
the release to trigger the install. Maybe I should try to
add "install" to the preperartionGoals.


>
> So why does the release plugin display a message indicating that an install
> should be done first? I don't know but would really like to ;-).
>
> ---
> Todd Thiessen
>
>
> > -----Original Message-----
> > From: Reinhard Nägele [mailto:reinhard.naegele@mgm-tp.com]
> > Sent: Tuesday, March 24, 2009 8:13 AM
> > To: Maven Users List
> > Subject: Re: Release plugin and multimodule interdependent childs
> >
> > I don't have a solution to your problem, but I would advice
> > against putting the real version number instead of
> > ${project.version}. It is good practice to avoid such
> > redundancy using ${project.version}, even though the release
> > plugin can deal with explicit versions. Using
> > ${project.version} is also suggested by "The Definitive Guide"
> > (http://www.sonatype.com/products/maven/documentation/book-defguide).
> >
> > Reinhard
> >
> >
> > Martin Eigenbrodt schrieb:
> > > I've replaced ${project.version} with 1.1-SNAPSHOT. The
> > Release plugin
> > > replaces this with 1.1 during release:prepare and fails
> > with the same
> > > message.
> > > I think the release plugin should first trigger a install
> > on the ejb
> > > and then run the servlet target.
> > >
> > > 2009/3/24 Jörg Schaible <jo...@gmx.de>
> > >
> > >
> > >> Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:
> > >>
> > >>
> > >>> This may be a beginner question,  but I haven't found any hints..
> > >>> I've got a project that contains a servlet and an ejb. The Servlet
> > >>>
> > >> depends
> > >>
> > >>> on the ejb. I've trouble releasing that as complete project.
> > >>>
> > >>> My directory Layout is like:
> > >>>
> > >>> pom.xml <- package type pom
> > >>>    servlet
> > >>>        pom.xml
> > >>>   ejb
> > >>>        pom.xml
> > >>>
> > >>> the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom
> > >>> don't specify a version (inherit them).
> > >>> The Servlet defines a dependecy on the ejb without
> > specifing a version.
> > >>> The dependencyMangement section from the parent pom contains:
> > >>>  <dependencies>
> > >>>     <dependency>
> > >>>       <groupId>myGroup<groupId>
> > >>>       <artifactId>ejb<artifactId>
> > >>>       <version>${project.version}</version>
> > >>>     </dependency>
> > >>>
> > >>> If I try release:prepare the build fails with "Failed to resolve
> > >>> artifacts: myGroup:ejb:1.1
> > >>>
> > >>> I understand why this happens but is there a obvious
> > solution? How
> > >>> do you release multimodule projects with interdependent childs?
> > >>>
> > >> Do not use that property and write the corretc version.
> > The release
> > >> plugin will then handle it and adjust it automatically.
> > >>
> > >> - Jörg
> > >>
> > >>
> > >>
> > ---------------------------------------------------------------------
> > >> 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Release plugin and multimodule interdependent childs

Posted by Todd Thiessen <th...@nortel.com>.
As far as my understanding goes, the release plugin "should" be able to handle depenencies between modules without installing those modules to your local repository. Oddly enough, the release plugin does display a warning saying that an install should be performed first if you have this situation.

If all else fails, you could do that (ie: install first) although there have been a number of Maven users on this list who have spoken against this approach.

So why does the release plugin display a message indicating that an install should be done first? I don't know but would really like to ;-). 

---
Todd Thiessen
 

> -----Original Message-----
> From: Reinhard Nägele [mailto:reinhard.naegele@mgm-tp.com] 
> Sent: Tuesday, March 24, 2009 8:13 AM
> To: Maven Users List
> Subject: Re: Release plugin and multimodule interdependent childs
> 
> I don't have a solution to your problem, but I would advice 
> against putting the real version number instead of 
> ${project.version}. It is good practice to avoid such 
> redundancy using ${project.version}, even though the release 
> plugin can deal with explicit versions. Using 
> ${project.version} is also suggested by "The Definitive Guide" 
> (http://www.sonatype.com/products/maven/documentation/book-defguide).
> 
> Reinhard
> 
> 
> Martin Eigenbrodt schrieb:
> > I've replaced ${project.version} with 1.1-SNAPSHOT. The 
> Release plugin 
> > replaces this with 1.1 during release:prepare and fails 
> with the same 
> > message.
> > I think the release plugin should first trigger a install 
> on the ejb 
> > and then run the servlet target.
> >
> > 2009/3/24 Jörg Schaible <jo...@gmx.de>
> >
> >   
> >> Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:
> >>
> >>     
> >>> This may be a beginner question,  but I haven't found any hints..
> >>> I've got a project that contains a servlet and an ejb. The Servlet
> >>>       
> >> depends
> >>     
> >>> on the ejb. I've trouble releasing that as complete project.
> >>>
> >>> My directory Layout is like:
> >>>
> >>> pom.xml <- package type pom
> >>>    servlet
> >>>        pom.xml
> >>>   ejb
> >>>        pom.xml
> >>>
> >>> the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom 
> >>> don't specify a version (inherit them).
> >>> The Servlet defines a dependecy on the ejb without 
> specifing a version.
> >>> The dependencyMangement section from the parent pom contains:
> >>>  <dependencies>
> >>>     <dependency>
> >>>       <groupId>myGroup<groupId>
> >>>       <artifactId>ejb<artifactId>
> >>>       <version>${project.version}</version>
> >>>     </dependency>
> >>>
> >>> If I try release:prepare the build fails with "Failed to resolve
> >>> artifacts: myGroup:ejb:1.1
> >>>
> >>> I understand why this happens but is there a obvious 
> solution? How 
> >>> do you release multimodule projects with interdependent childs?
> >>>       
> >> Do not use that property and write the corretc version. 
> The release 
> >> plugin will then handle it and adjust it automatically.
> >>
> >> - Jörg
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> 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
> 
> 

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


Re: Release plugin and multimodule interdependent childs

Posted by Reinhard Nägele <re...@mgm-tp.com>.
I don't have a solution to your problem, but I would advice against 
putting the real version number instead of ${project.version}. It is 
good practice to avoid such redundancy using ${project.version}, even 
though the release plugin can deal with explicit versions. Using 
${project.version} is also suggested by "The Definitive Guide" 
(http://www.sonatype.com/products/maven/documentation/book-defguide).

Reinhard


Martin Eigenbrodt schrieb:
> I've replaced ${project.version} with 1.1-SNAPSHOT. The Release plugin
> replaces this with 1.1 during release:prepare and fails with
> the same message.
> I think the release plugin should first trigger a install on the ejb and
> then run the servlet target.
>
> 2009/3/24 Jörg Schaible <jo...@gmx.de>
>
>   
>> Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:
>>
>>     
>>> This may be a beginner question,  but I haven't found any hints..
>>> I've got a project that contains a servlet and an ejb. The Servlet
>>>       
>> depends
>>     
>>> on the ejb. I've trouble releasing that as complete project.
>>>
>>> My directory Layout is like:
>>>
>>> pom.xml <- package type pom
>>>    servlet
>>>        pom.xml
>>>   ejb
>>>        pom.xml
>>>
>>> the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom don't
>>> specify a version (inherit them).
>>> The Servlet defines a dependecy on the ejb without specifing a version.
>>> The dependencyMangement section from the parent pom contains:
>>>  <dependencies>
>>>     <dependency>
>>>       <groupId>myGroup<groupId>
>>>       <artifactId>ejb<artifactId>
>>>       <version>${project.version}</version>
>>>     </dependency>
>>>
>>> If I try release:prepare the build fails with "Failed to resolve
>>> artifacts: myGroup:ejb:1.1
>>>
>>> I understand why this happens but is there a obvious solution? How do you
>>> release multimodule projects with interdependent childs?
>>>       
>> Do not use that property and write the corretc version. The release plugin
>> will then handle it and adjust it automatically.
>>
>> - Jörg
>>
>>
>> ---------------------------------------------------------------------
>> 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: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Martin,

Martin Eigenbrodt wrote at Dienstag, 24. März 2009 12:00:

> I've replaced ${project.version} with 1.1-SNAPSHOT. The Release plugin
> replaces this with 1.1 during release:prepare and fails with
> the same message.
> I think the release plugin should first trigger a install on the ejb and
> then run the servlet target.

This works for me. You should use the latest release-plugin though.

- Jörg


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


Re: Release plugin and multimodule interdependent childs

Posted by Martin Eigenbrodt <ma...@googlemail.com>.
I've replaced ${project.version} with 1.1-SNAPSHOT. The Release plugin
replaces this with 1.1 during release:prepare and fails with
the same message.
I think the release plugin should first trigger a install on the ejb and
then run the servlet target.

2009/3/24 Jörg Schaible <jo...@gmx.de>

> Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:
>
> > This may be a beginner question,  but I haven't found any hints..
> > I've got a project that contains a servlet and an ejb. The Servlet
> depends
> > on the ejb. I've trouble releasing that as complete project.
> >
> > My directory Layout is like:
> >
> > pom.xml <- package type pom
> >    servlet
> >        pom.xml
> >   ejb
> >        pom.xml
> >
> > the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom don't
> > specify a version (inherit them).
> > The Servlet defines a dependecy on the ejb without specifing a version.
> > The dependencyMangement section from the parent pom contains:
> >  <dependencies>
> >     <dependency>
> >       <groupId>myGroup<groupId>
> >       <artifactId>ejb<artifactId>
> >       <version>${project.version}</version>
> >     </dependency>
> >
> > If I try release:prepare the build fails with "Failed to resolve
> > artifacts: myGroup:ejb:1.1
> >
> > I understand why this happens but is there a obvious solution? How do you
> > release multimodule projects with interdependent childs?
>
> Do not use that property and write the corretc version. The release plugin
> will then handle it and adjust it automatically.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Release plugin and multimodule interdependent childs

Posted by Jörg Schaible <jo...@gmx.de>.
Martin Eigenbrodt wrote at Dienstag, 24. März 2009 10:16:

> This may be a beginner question,  but I haven't found any hints..
> I've got a project that contains a servlet and an ejb. The Servlet depends
> on the ejb. I've trouble releasing that as complete project.
> 
> My directory Layout is like:
> 
> pom.xml <- package type pom
>    servlet
>        pom.xml
>   ejb
>        pom.xml
> 
> the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom don't
> specify a version (inherit them).
> The Servlet defines a dependecy on the ejb without specifing a version.
> The dependencyMangement section from the parent pom contains:
>  <dependencies>
>     <dependency>
>       <groupId>myGroup<groupId>
>       <artifactId>ejb<artifactId>
>       <version>${project.version}</version>
>     </dependency>
> 
> If I try release:prepare the build fails with "Failed to resolve
> artifacts: myGroup:ejb:1.1
> 
> I understand why this happens but is there a obvious solution? How do you
> release multimodule projects with interdependent childs?

Do not use that property and write the corretc version. The release plugin
will then handle it and adjust it automatically.

- Jörg


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


Re: Release plugin and multimodule interdependent childs

Posted by "David C. Hicks" <dh...@i-hicks.org>.
There was a pretty long thread about this exact issue about two or three 
weeks ago.  I encountered the same issue.  My solution, eventually, was 
to use the "preparationGoals" property when I run release:prepare to 
force an "install".  The problem appears to be that maven-release-plugin 
fails to use objects in the reactor when resolving dependencies - at 
least, in the prepare goal.  I can't swear to that, but it's my 
uneducated observation.

Using a ${project.version} to version your modules works just fine.

Here is my prepare command line:

mvn -DpreparationGoals="clean,install" release:prepare

Good luck!
Dave


Martin Eigenbrodt wrote:
> This may be a beginner question,  but I haven't found any hints..
> I've got a project that contains a servlet and an ejb. The Servlet depends
> on the ejb. I've trouble releasing that as complete project.
>
> My directory Layout is like:
>
> pom.xml <- package type pom
>    servlet
>        pom.xml
>   ejb
>        pom.xml
>
> the parent pom has version 1.1-SNAPSHOT.  The Servlet an ejb pom don't
> specify a version (inherit them).
> The Servlet defines a dependecy on the ejb without specifing a version.
> The dependencyMangement section from the parent pom contains:
>  <dependencies>
>     <dependency>
>       <groupId>myGroup<groupId>
>       <artifactId>ejb<artifactId>
>       <version>${project.version}</version>
>     </dependency>
>
> If I try release:prepare the build fails with "Failed to resolve artifacts:
> myGroup:ejb:1.1
>
> I understand why this happens but is there a obvious solution? How do you
> release multimodule projects with interdependent childs?
>
> Best regards,
>
> Martin
>
>   

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