You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Richard Chamberlain <ri...@caplin.com> on 2008/05/13 14:39:14 UTC

cant build the next version until dependency built in a multi-module project

Hi, 

 

I've got a multi-module project set out like:

 

Parent

 +-Module A

 +-Module B

 +-Core

 

- Both module A and Module B are separate artefacts that need to be in
sync with each other.

- Both A and B depend on core

 

The problem

----------------

If the current version is 1.0-SNAPSHOT, this builds quite happily.

When I do a release I get the error that the dependency core-1.0 cannot
be found. But 1.0 hasn't had the chance to build yet!

 

My project layout

---------------------

Parent:

      <modules>

            <module>Core</module>

            <module>ModuleA</module>

            <module>ModuleB</module>

      </modules>

 

Core

------

  <parent>

    <artifactId>Parent</artifactId>

    <groupId>com.myapp</groupId>

    <version>1.0-SNAPSHOT</version>

  </parent>

 

Module A & B

------------

  <parent>

    <artifactId>Parent</artifactId>

    <groupId>com.myapp</groupId>

    <version>1.0-SNAPSHOT</version>

    <relativePath>../pom.xml</relativePath>    

  </parent>

  ...

    <dependency>

      <groupId>com.myapp</groupId>

      <artifactId>core</artifactId>

      <version>${project.version}</version>

    </dependency>

 

Thanks,

 

Rich

 

 

 


Re: cant build the next version until dependency built in a multi-module project

Posted by Rémy Sanlaville <re...@gmail.com>.
Hi,

It's a common problem.
Cf.
http://www.nabble.com/release-problem-with-multi-modules-project-tt14101519.html#a14102400

HTH,

Rémy

RE: cant build the next version until dependency built in a multi-module project

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
The current plugin api doesn't allow it unfortunately. This is why we
are deprecating aggregator plugins that are bound to the lifecycle in
2.1. The core attempts to be smart and ignores the sibling jars that are
missing, but this could cause problems too. The original issue for this
was http://jira.codehaus.org/browse/MNG-2277

-----Original Message-----
From: Richard Chamberlain [mailto:richard.chamberlain@caplin.com] 
Sent: Tuesday, May 13, 2008 11:18 AM
To: Maven Users List
Subject: RE: cant build the next version until dependency built in a
multi-module project

Then that plugin should exclude artefacts that are going to be built? Or
is it not that simple?

-----Original Message-----
From: Brian E. Fox [mailto:brianf@reply.infinity.nu] 
Sent: 13 May 2008 15:28
To: Maven Users List
Subject: RE: cant build the next version until dependency built in a
multi-module project

One of the plugins in your build is asking Maven to resolve ALL project
and ALL dependencies and thus it's a catch-22.

-----Original Message-----
From: Richard Chamberlain [mailto:richard.chamberlain@caplin.com] 
Sent: Tuesday, May 13, 2008 9:17 AM
To: Maven Users List
Subject: RE: cant build the next version until dependency built in a
multi-module project

It would pull the previous snapshot from the remote repository. 

If I deleted all the versions of core everywhere, the build would fail.

I think maven resolves the dependencies before it builds, and because it
hasn't built yet the dependency check fails.

Has anyone sorted this out before?

One workaround I've got is to build future versions of core and install
them so when I move to a new version it resolves the pre-built one, but
the build overwrites it with the latest code. However it sucks!

Rich

-----Original Message-----
From: bonawitz@gmail.com [mailto:bonawitz@gmail.com] On Behalf Of Keith
Bonawitz
Sent: 13 May 2008 14:03
To: Maven Users List
Subject: Re: cant build the next version until dependency built in a
multi-module project

This isn't a solution, but may help narrow down the scope of the issue:
Have you tried deleting your local repository before building the
snapshot version?  My guess is that that will fail like the release
fails; if so, this suggests that the only reason the snapshot is
building is because the module dependencies are getting resolved
against a core snapshot from your local repository.  (At least, this
would correspond with other behavior I've seen -- and would love to
know the solution for!)

Keith

On Tue, May 13, 2008 at 8:39 AM, Richard Chamberlain
<ri...@caplin.com> wrote:
> Hi,
>
>
>
>  I've got a multi-module project set out like:
>
>
>
>  Parent
>
>   +-Module A
>
>   +-Module B
>
>   +-Core
>
>
>
>  - Both module A and Module B are separate artefacts that need to be
in
>  sync with each other.
>
>  - Both A and B depend on core
>
>
>
>  The problem
>
>  ----------------
>
>  If the current version is 1.0-SNAPSHOT, this builds quite happily.
>
>  When I do a release I get the error that the dependency core-1.0
cannot
>  be found. But 1.0 hasn't had the chance to build yet!
>
>
>
>  My project layout
>
>  ---------------------
>
>  Parent:
>
>       <modules>
>
>             <module>Core</module>
>
>             <module>ModuleA</module>
>
>             <module>ModuleB</module>
>
>       </modules>
>
>
>
>  Core
>
>  ------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>   </parent>
>
>
>
>  Module A & B
>
>  ------------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>     <relativePath>../pom.xml</relativePath>
>
>   </parent>
>
>   ...
>
>     <dependency>
>
>       <groupId>com.myapp</groupId>
>
>       <artifactId>core</artifactId>
>
>       <version>${project.version}</version>
>
>     </dependency>
>
>
>
>  Thanks,
>
>
>
>  Rich
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
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


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


RE: cant build the next version until dependency built in a multi-module project

Posted by Richard Chamberlain <ri...@caplin.com>.
Then that plugin should exclude artefacts that are going to be built? Or
is it not that simple?

-----Original Message-----
From: Brian E. Fox [mailto:brianf@reply.infinity.nu] 
Sent: 13 May 2008 15:28
To: Maven Users List
Subject: RE: cant build the next version until dependency built in a
multi-module project

One of the plugins in your build is asking Maven to resolve ALL project
and ALL dependencies and thus it's a catch-22.

-----Original Message-----
From: Richard Chamberlain [mailto:richard.chamberlain@caplin.com] 
Sent: Tuesday, May 13, 2008 9:17 AM
To: Maven Users List
Subject: RE: cant build the next version until dependency built in a
multi-module project

It would pull the previous snapshot from the remote repository. 

If I deleted all the versions of core everywhere, the build would fail.

I think maven resolves the dependencies before it builds, and because it
hasn't built yet the dependency check fails.

Has anyone sorted this out before?

One workaround I've got is to build future versions of core and install
them so when I move to a new version it resolves the pre-built one, but
the build overwrites it with the latest code. However it sucks!

Rich

-----Original Message-----
From: bonawitz@gmail.com [mailto:bonawitz@gmail.com] On Behalf Of Keith
Bonawitz
Sent: 13 May 2008 14:03
To: Maven Users List
Subject: Re: cant build the next version until dependency built in a
multi-module project

This isn't a solution, but may help narrow down the scope of the issue:
Have you tried deleting your local repository before building the
snapshot version?  My guess is that that will fail like the release
fails; if so, this suggests that the only reason the snapshot is
building is because the module dependencies are getting resolved
against a core snapshot from your local repository.  (At least, this
would correspond with other behavior I've seen -- and would love to
know the solution for!)

Keith

On Tue, May 13, 2008 at 8:39 AM, Richard Chamberlain
<ri...@caplin.com> wrote:
> Hi,
>
>
>
>  I've got a multi-module project set out like:
>
>
>
>  Parent
>
>   +-Module A
>
>   +-Module B
>
>   +-Core
>
>
>
>  - Both module A and Module B are separate artefacts that need to be
in
>  sync with each other.
>
>  - Both A and B depend on core
>
>
>
>  The problem
>
>  ----------------
>
>  If the current version is 1.0-SNAPSHOT, this builds quite happily.
>
>  When I do a release I get the error that the dependency core-1.0
cannot
>  be found. But 1.0 hasn't had the chance to build yet!
>
>
>
>  My project layout
>
>  ---------------------
>
>  Parent:
>
>       <modules>
>
>             <module>Core</module>
>
>             <module>ModuleA</module>
>
>             <module>ModuleB</module>
>
>       </modules>
>
>
>
>  Core
>
>  ------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>   </parent>
>
>
>
>  Module A & B
>
>  ------------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>     <relativePath>../pom.xml</relativePath>
>
>   </parent>
>
>   ...
>
>     <dependency>
>
>       <groupId>com.myapp</groupId>
>
>       <artifactId>core</artifactId>
>
>       <version>${project.version}</version>
>
>     </dependency>
>
>
>
>  Thanks,
>
>
>
>  Rich
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
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: cant build the next version until dependency built in a multi-module project

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
One of the plugins in your build is asking Maven to resolve ALL project
and ALL dependencies and thus it's a catch-22.

-----Original Message-----
From: Richard Chamberlain [mailto:richard.chamberlain@caplin.com] 
Sent: Tuesday, May 13, 2008 9:17 AM
To: Maven Users List
Subject: RE: cant build the next version until dependency built in a
multi-module project

It would pull the previous snapshot from the remote repository. 

If I deleted all the versions of core everywhere, the build would fail.

I think maven resolves the dependencies before it builds, and because it
hasn't built yet the dependency check fails.

Has anyone sorted this out before?

One workaround I've got is to build future versions of core and install
them so when I move to a new version it resolves the pre-built one, but
the build overwrites it with the latest code. However it sucks!

Rich

-----Original Message-----
From: bonawitz@gmail.com [mailto:bonawitz@gmail.com] On Behalf Of Keith
Bonawitz
Sent: 13 May 2008 14:03
To: Maven Users List
Subject: Re: cant build the next version until dependency built in a
multi-module project

This isn't a solution, but may help narrow down the scope of the issue:
Have you tried deleting your local repository before building the
snapshot version?  My guess is that that will fail like the release
fails; if so, this suggests that the only reason the snapshot is
building is because the module dependencies are getting resolved
against a core snapshot from your local repository.  (At least, this
would correspond with other behavior I've seen -- and would love to
know the solution for!)

Keith

On Tue, May 13, 2008 at 8:39 AM, Richard Chamberlain
<ri...@caplin.com> wrote:
> Hi,
>
>
>
>  I've got a multi-module project set out like:
>
>
>
>  Parent
>
>   +-Module A
>
>   +-Module B
>
>   +-Core
>
>
>
>  - Both module A and Module B are separate artefacts that need to be
in
>  sync with each other.
>
>  - Both A and B depend on core
>
>
>
>  The problem
>
>  ----------------
>
>  If the current version is 1.0-SNAPSHOT, this builds quite happily.
>
>  When I do a release I get the error that the dependency core-1.0
cannot
>  be found. But 1.0 hasn't had the chance to build yet!
>
>
>
>  My project layout
>
>  ---------------------
>
>  Parent:
>
>       <modules>
>
>             <module>Core</module>
>
>             <module>ModuleA</module>
>
>             <module>ModuleB</module>
>
>       </modules>
>
>
>
>  Core
>
>  ------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>   </parent>
>
>
>
>  Module A & B
>
>  ------------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>     <relativePath>../pom.xml</relativePath>
>
>   </parent>
>
>   ...
>
>     <dependency>
>
>       <groupId>com.myapp</groupId>
>
>       <artifactId>core</artifactId>
>
>       <version>${project.version}</version>
>
>     </dependency>
>
>
>
>  Thanks,
>
>
>
>  Rich
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
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: cant build the next version until dependency built in a multi-module project

Posted by Richard Chamberlain <ri...@caplin.com>.
It would pull the previous snapshot from the remote repository. 

If I deleted all the versions of core everywhere, the build would fail.

I think maven resolves the dependencies before it builds, and because it
hasn't built yet the dependency check fails.

Has anyone sorted this out before?

One workaround I've got is to build future versions of core and install
them so when I move to a new version it resolves the pre-built one, but
the build overwrites it with the latest code. However it sucks!

Rich

-----Original Message-----
From: bonawitz@gmail.com [mailto:bonawitz@gmail.com] On Behalf Of Keith
Bonawitz
Sent: 13 May 2008 14:03
To: Maven Users List
Subject: Re: cant build the next version until dependency built in a
multi-module project

This isn't a solution, but may help narrow down the scope of the issue:
Have you tried deleting your local repository before building the
snapshot version?  My guess is that that will fail like the release
fails; if so, this suggests that the only reason the snapshot is
building is because the module dependencies are getting resolved
against a core snapshot from your local repository.  (At least, this
would correspond with other behavior I've seen -- and would love to
know the solution for!)

Keith

On Tue, May 13, 2008 at 8:39 AM, Richard Chamberlain
<ri...@caplin.com> wrote:
> Hi,
>
>
>
>  I've got a multi-module project set out like:
>
>
>
>  Parent
>
>   +-Module A
>
>   +-Module B
>
>   +-Core
>
>
>
>  - Both module A and Module B are separate artefacts that need to be
in
>  sync with each other.
>
>  - Both A and B depend on core
>
>
>
>  The problem
>
>  ----------------
>
>  If the current version is 1.0-SNAPSHOT, this builds quite happily.
>
>  When I do a release I get the error that the dependency core-1.0
cannot
>  be found. But 1.0 hasn't had the chance to build yet!
>
>
>
>  My project layout
>
>  ---------------------
>
>  Parent:
>
>       <modules>
>
>             <module>Core</module>
>
>             <module>ModuleA</module>
>
>             <module>ModuleB</module>
>
>       </modules>
>
>
>
>  Core
>
>  ------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>   </parent>
>
>
>
>  Module A & B
>
>  ------------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>     <relativePath>../pom.xml</relativePath>
>
>   </parent>
>
>   ...
>
>     <dependency>
>
>       <groupId>com.myapp</groupId>
>
>       <artifactId>core</artifactId>
>
>       <version>${project.version}</version>
>
>     </dependency>
>
>
>
>  Thanks,
>
>
>
>  Rich
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
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: cant build the next version until dependency built in a multi-module project

Posted by Keith Bonawitz <bo...@naviasystems.com>.
This isn't a solution, but may help narrow down the scope of the issue:
Have you tried deleting your local repository before building the
snapshot version?  My guess is that that will fail like the release
fails; if so, this suggests that the only reason the snapshot is
building is because the module dependencies are getting resolved
against a core snapshot from your local repository.  (At least, this
would correspond with other behavior I've seen -- and would love to
know the solution for!)

Keith

On Tue, May 13, 2008 at 8:39 AM, Richard Chamberlain
<ri...@caplin.com> wrote:
> Hi,
>
>
>
>  I've got a multi-module project set out like:
>
>
>
>  Parent
>
>   +-Module A
>
>   +-Module B
>
>   +-Core
>
>
>
>  - Both module A and Module B are separate artefacts that need to be in
>  sync with each other.
>
>  - Both A and B depend on core
>
>
>
>  The problem
>
>  ----------------
>
>  If the current version is 1.0-SNAPSHOT, this builds quite happily.
>
>  When I do a release I get the error that the dependency core-1.0 cannot
>  be found. But 1.0 hasn't had the chance to build yet!
>
>
>
>  My project layout
>
>  ---------------------
>
>  Parent:
>
>       <modules>
>
>             <module>Core</module>
>
>             <module>ModuleA</module>
>
>             <module>ModuleB</module>
>
>       </modules>
>
>
>
>  Core
>
>  ------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>   </parent>
>
>
>
>  Module A & B
>
>  ------------
>
>   <parent>
>
>     <artifactId>Parent</artifactId>
>
>     <groupId>com.myapp</groupId>
>
>     <version>1.0-SNAPSHOT</version>
>
>     <relativePath>../pom.xml</relativePath>
>
>   </parent>
>
>   ...
>
>     <dependency>
>
>       <groupId>com.myapp</groupId>
>
>       <artifactId>core</artifactId>
>
>       <version>${project.version}</version>
>
>     </dependency>
>
>
>
>  Thanks,
>
>
>
>  Rich
>
>
>
>
>
>
>
>

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