How to change the invoked goals at runtime

2007-03-08 Thread Daniel Beland

Hi,


I am trying to migrate our projects to maven 2.0.5 (have been using maven 1
for 2 years now).

I would like to know how I can invoke maven to package the artifact only
when the version does not contain SNAPSHOT, and install it if it contains
SNAPSHOT.
In maven 1 I was using a goal like this:

   
   
   
   
   

   
   
   
   
   


This is because I do not want cruise control to install an artifact if it is
not a SNAPSHOT. (Released version should always be downloaded from our
central repository).
It happened too many times that developers forget to change the version to
SNAPSHOT after a release, and we overwrite the local artifact and break the
build of other modules.


Profiles cannot be called based on ${pom.version} ending with SNAPSHOT.
I checked the plugin development, but I didn't find how we can alter the
goals from a plugin.


Someone has an idea how I can attain this?

Thanks,
Daniel


Re: How to change the invoked goals at runtime

2007-03-08 Thread Jerome Lacoste

On 3/8/07, Daniel Beland <[EMAIL PROTECTED]> wrote:

Hi,


I am trying to migrate our projects to maven 2.0.5 (have been using maven 1
for 2 years now).

I would like to know how I can invoke maven to package the artifact only
when the version does not contain SNAPSHOT, and install it if it contains
SNAPSHOT.
In maven 1 I was using a goal like this:














This is because I do not want cruise control to install an artifact if it is
not a SNAPSHOT. (Released version should always be downloaded from our
central repository).


install will only happen under the local repository of the user
running your cruisecontrol instance. Why is that affecting you ?


It happened too many times that developers forget to change the version to
SNAPSHOT after a release, and we overwrite the local artifact and break the
build of other modules.


If that's the root of your problem, use the release plugin and it
should disappear.

J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to change the invoked goals at runtime

2007-03-08 Thread Daniel Beland

Ok let me explin it with more details.

I have projects A, B and C, giving artifacts a-1.0.jar, b-1.0.war and
c-1.0.war.

B as a dependency on a-1.0.jar
C as a dependency on a-1.0.jar.


We modify A and B only => (A version should become a-1.1-SNAPSHOT.jar)
But the developer commit it and forget to change the version, the local lib
a-1.0.jar is installed over with what should have been a-1.1-SNAPSHOT.jar.

The build of B breaks because a-1.1-SNAPSHOT.jar cannot be found, he
realizes it and change it. Everything seems ok from now on, no harms done.

We make a modification to C later, build of C breaks, we don't understand
why and can spend a long time trying to find out the reason (because the
local lib a-1.0.jar is not the same as on the central repository). We have
to delete it from the local repository to make sure it is downloaded
properly next time.


To make sure this kind of situation does not happen again, I would like to
install the artifacts only when the version is SNAPSHOT. With cruise control
I cannot configure it to build the project only when the version is
SNAPSHOT. I need to find a way to do it within the maven build lifecycle.



On 08/03/07, Jerome Lacoste <[EMAIL PROTECTED]> wrote:


On 3/8/07, Daniel Beland <[EMAIL PROTECTED]> wrote:
> Hi,
>
>
> I am trying to migrate our projects to maven 2.0.5 (have been using
maven 1
> for 2 years now).
>
> I would like to know how I can invoke maven to package the artifact only
> when the version does not contain SNAPSHOT, and install it if it
contains
> SNAPSHOT.
> In maven 1 I was using a goal like this:
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
>
>
> This is because I do not want cruise control to install an artifact if
it is
> not a SNAPSHOT. (Released version should always be downloaded from our
> central repository).

install will only happen under the local repository of the user
running your cruisecontrol instance. Why is that affecting you ?

> It happened too many times that developers forget to change the version
to
> SNAPSHOT after a release, and we overwrite the local artifact and break
the
> build of other modules.

If that's the root of your problem, use the release plugin and it
should disappear.

J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to change the invoked goals at runtime

2007-03-08 Thread Jerome Lacoste

On 3/8/07, Daniel Beland <[EMAIL PROTECTED]> wrote:

Ok let me explin it with more details.

I have projects A, B and C, giving artifacts a-1.0.jar, b-1.0.war and
c-1.0.war.

B as a dependency on a-1.0.jar
C as a dependency on a-1.0.jar.


We modify A and B only => (A version should become a-1.1-SNAPSHOT.jar)
But the developer commit it and forget to change the version, the local lib
a-1.0.jar is installed over with what should have been a-1.1-SNAPSHOT.jar.

The build of B breaks because a-1.1-SNAPSHOT.jar cannot be found, he
realizes it and change it. Everything seems ok from now on, no harms done.

We make a modification to C later, build of C breaks, we don't understand
why and can spend a long time trying to find out the reason (because the
local lib a-1.0.jar is not the same as on the central repository). We have
to delete it from the local repository to make sure it is downloaded
properly next time.


To make sure this kind of situation does not happen again, I would like to
install the artifacts only when the version is SNAPSHOT. With cruise control
I cannot configure it to build the project only when the version is
SNAPSHOT. I need to find a way to do it within the maven build lifecycle.


OK got it.

If you use the release plugin then your developpers won't make the
mistake again as the version change in the pom will happen
automatically.

I personally empty the local repository under my profile (and CC's
one) every now and then because I want to avoid caching issues.

J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to change the invoked goals at runtime

2007-03-08 Thread Daniel Beland

I had a look at the new release plugin, saw what you mean, It will update
the version back to SNAPSHOT, nice little feature that was missing in maven
1.


Thanks for your help



On 08/03/07, Daniel Beland <[EMAIL PROTECTED]> wrote:



Hi,


I am trying to migrate our projects to maven 2.0.5 (have been using maven
1 for 2 years now).

I would like to know how I can invoke maven to package the artifact only
when the version does not contain SNAPSHOT, and install it if it contains
SNAPSHOT.
In maven 1 I was using a goal like this:














This is because I do not want cruise control to install an artifact if it
is not a SNAPSHOT. (Released version should always be downloaded from our
central repository).
It happened too many times that developers forget to change the version to
SNAPSHOT after a release, and we overwrite the local artifact and break the
build of other modules.


Profiles cannot be called based on ${ pom.version} ending with SNAPSHOT.
I checked the plugin development, but I didn't find how we can alter the
goals from a plugin.


Someone has an idea how I can attain this?

Thanks,
Daniel





Re: How to change the invoked goals at runtime

2007-03-08 Thread Jerome Lacoste

On 3/8/07, Daniel Beland <[EMAIL PROTECTED]> wrote:

I had a look at the new release plugin, saw what you mean, It will update
the version back to SNAPSHOT, nice little feature that was missing in maven
1.


Thanks for your help


and another thing that might help you is the dependency plugin.
In particular:  dependency:purge-local-repository

http://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html

(I've never used it)

J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]