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_senior <ri...@gmail.com> on 2014/03/14 13:46:33 UTC

how to only build if version is changed..

Hello,

We are using maven, jenkins and nexus for continuous integration.

Our trunk branch contains no snapshots, and jenkins is polling the scm and
building on any change.
However periodically a developer may check things in without upversioning
the pom.
When they do this the build fails at deploy as nexus will not allow to full
release versions with the same number.
Which is obviously good... But I would like to fail the build early, before
deploy, so that when a developer tries to build
the project in their local workspace, they can see that they must change the
version number.

How would I add a goal to maven that failed, if nexus contains a binary of
the project I'm building, at the same version as the pom?

I'm guessing I'd need to use the enforcer, and perhaps the maven versions
mojo, but I don't know the exact config?



--
View this message in context: http://maven.40175.n5.nabble.com/how-to-only-build-if-version-is-changed-tp5788337.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: how to only build if version is changed..

Posted by Barrie Treloar <ba...@gmail.com>.
On 14 March 2014 23:16, richard_senior <ri...@gmail.com> wrote:

> Hello,
>
> We are using maven, jenkins and nexus for continuous integration.
>
> Our trunk branch contains no snapshots, and jenkins is polling the scm and
> building on any change.
> However periodically a developer may check things in without upversioning
> the pom.
> When they do this the build fails at deploy as nexus will not allow to full
> release versions with the same number.
> Which is obviously good... But I would like to fail the build early, before
> deploy, so that when a developer tries to build
> the project in their local workspace, they can see that they must change
> the
> version number.
>
> How would I add a goal to maven that failed, if nexus contains a binary of
> the project I'm building, at the same version as the pom?
>
> I'm guessing I'd need to use the enforcer, and perhaps the maven versions
> mojo, but I don't know the exact config?


Why aren't you using snapshots?
This is exactly what they are used for.

Re: how to only build if version is changed..

Posted by Ron Wheeler <rw...@artifact-software.com>.
I would have thought that the trunk would always have a SNAPSHOT version 
and branches would be a series of SNAPSHOTS ending in a RELEASE which 
has been merged back into the trunk as part of the next version's 
current SNAPSHOT.

In order for someone to get into trouble, they would have to check-in a 
revision to a released branch.
There should be no way to get into trouble by checking things into the 
trunk since it would always be a SNAPSHOT.

Is Jenkins watching for check-ins on both the trunk and branches?

Perhaps we need more details about how the release policy is supposed to 
interact with the SCM's trunk and branches and Jenkins configuration of 
automatic builds of branches and trunks.

Ron


On 15/03/2014 8:31 AM, Anders Hammar wrote:
> The pom on trunk or any branch should *always* specify a SNAPSHOT version.
>
> /Anders
>
>
> On Fri, Mar 14, 2014 at 1:46 PM, richard_senior <ri...@gmail.com>wrote:
>
>> Hello,
>>
>> We are using maven, jenkins and nexus for continuous integration.
>>
>> Our trunk branch contains no snapshots, and jenkins is polling the scm and
>> building on any change.
>> However periodically a developer may check things in without upversioning
>> the pom.
>> When they do this the build fails at deploy as nexus will not allow to full
>> release versions with the same number.
>> Which is obviously good... But I would like to fail the build early, before
>> deploy, so that when a developer tries to build
>> the project in their local workspace, they can see that they must change
>> the
>> version number.
>>
>> How would I add a goal to maven that failed, if nexus contains a binary of
>> the project I'm building, at the same version as the pom?
>>
>> I'm guessing I'd need to use the enforcer, and perhaps the maven versions
>> mojo, but I don't know the exact config?
>>
>>
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/how-to-only-build-if-version-is-changed-tp5788337.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
>>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Re: how to only build if version is changed..

Posted by Anders Hammar <an...@hammar.net>.
The pom on trunk or any branch should *always* specify a SNAPSHOT version.

/Anders


On Fri, Mar 14, 2014 at 1:46 PM, richard_senior <ri...@gmail.com>wrote:

> Hello,
>
> We are using maven, jenkins and nexus for continuous integration.
>
> Our trunk branch contains no snapshots, and jenkins is polling the scm and
> building on any change.
> However periodically a developer may check things in without upversioning
> the pom.
> When they do this the build fails at deploy as nexus will not allow to full
> release versions with the same number.
> Which is obviously good... But I would like to fail the build early, before
> deploy, so that when a developer tries to build
> the project in their local workspace, they can see that they must change
> the
> version number.
>
> How would I add a goal to maven that failed, if nexus contains a binary of
> the project I'm building, at the same version as the pom?
>
> I'm guessing I'd need to use the enforcer, and perhaps the maven versions
> mojo, but I don't know the exact config?
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/how-to-only-build-if-version-is-changed-tp5788337.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
>
>