You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Olaf Meske <om...@softcare.de> on 2007/10/17 11:32:42 UTC

How to setup repeatable builds with maven or how to tag dependencies

Hi All,

I'm a beginner of Maven and I'm doing some research if we could use 
maven for some of our projects.
One thing that we really need, is to repeat our builds from the tagged 
versions from the cvs/svn with the exact same result. But I understand 
that maven will get the newest matching version of any dependency on 
every run.

So all I'll can think to get this to work are these following ways:

1.) To check-in ALL dependencies into a local maven repository and this 
maven repository into the cvs/svn, but with this this approach I'll lost 
the possibility to use any 3rd party maven proxy to handle the external 
dependencies and I really have to get and check-in every external 
dependency by myself.

OR

2.) To check-in every assembly into the cvs/svn repository and to tag 
this assembly. But with this is double the source of every snapshot 
within the cvs/svn and I'll lost much of the project internal history 
and dependencies (with the assembly I'll not be able to step through the 
history of any source files, because I duplicated it).

OR

3.) To used fixed versions with the dependencies and no range or 
matching versions. But with this I'll lost some of the main features of 
maven, to solve the dependencies between the dependencies.

Are there any other ways to setup maven projects to get repeatable 
builds with dependencies?


Olaf


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


RE: How to setup repeatable builds with maven or how to tag dependencies

Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
Olaf Meske wrote on Wednesday, October 17, 2007 11:33 AM:

> Hi All,
> 
> I'm a beginner of Maven and I'm doing some research if we could use
> maven for some of our projects.
> One thing that we really need, is to repeat our builds from
> the tagged
> versions from the cvs/svn with the exact same result. But I understand
> that maven will get the newest matching version of any dependency on
> every run. 

No, it will use the versions you have defined (unless you are using SNAPSHOTs, but you cannot release anything depending on a SNAPSHOT anyway). However, it will try to use newer plugins, therefore you should define a fix version in the pluginManagement section.

[snip]

> 3.) To used fixed versions with the dependencies and no range or
> matching versions. But with this I'll lost some of the main
> features of
> maven, to solve the dependencies between the dependencies.

It is no good idea to use ranges if it means that it includes versions you don't know (yet). Use fix versions and let Maven decide. The same Maven version will always decide in the same way.

> Are there any other ways to setup maven projects to get repeatable
> builds with dependencies? 

Use a company repository for the downloaded artifacts and save that in a backup.

- Jörg

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


Re: How to setup repeatable builds with maven or how to tag dependencies

Posted by Thorsten Heit <th...@gmx.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Olaf,

>> - your internal dependencies are setup using -SNAPSHOT as an alias for
>> "always the latest"?
> I haven't setup any project now, but when I setup internal dependencies
> I'll think I'll use the SNAPSHOT feature during development, but I have
> to use a fixed, distinct version at release time.

Just use the release plugin. This should solve your concerns:

- - Releasing a product that depends on snapshots (i.e. on development
versions of one or more artifacts) is not possible.
- - A released product will automatically be tagged in SCM so you should
always be able to reproduce the corresponding product build.


> So, I think I'll adopt the proposal of Jörg and use a company repository
> for the downloaded artifacts.

A company repository makes sense not only for caching downloaded
external artifacts, but also for your internally produced ones. Have a
look at Artifactory, Archiva or Proximity (to mention some).


HTH

Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkcWEbUACgkQQvObkgCcDe1nnwCgprnWsMC2oNd1rVYjoopobYuB
T8oAoPdMVnM2Yhpk25Vyb0Oio1Y2+g4y
=/Yqp
-----END PGP SIGNATURE-----

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


Re: How to setup repeatable builds with maven or how to tag dependencies

Posted by Olaf Meske <om...@softcare.de>.
Torsten Schlabach schrieb:
> Hi Olaf,
> 
> just to help me understand:
> 
> Am I assuming right that
> 
> - some of your dependencies are external to your project and some of them are internal, i.e. different parts (modules) of your project which move at different speed in terms of SCM?
Yes
> 
> - your internal dependencies are setup using -SNAPSHOT as an alias for "always the latest"?
I haven't setup any project now, but when I setup internal dependencies 
I'll think I'll use the SNAPSHOT feature during development, but I have 
to use a fixed, distinct version at release time.
> 
> In case my assumptions would be right, would it then help you if you'd record just a map of the exact timestamps used in a given build and have a facility to let Maven pick up just that versions when trying to build again?
I don't really like to match any tagging version information from the 
SCM via a timestamp to the rest of the dependencies from a maven repository.


So, I think I'll adopt the proposal of Jörg and use a company repository 
for the downloaded artifacts.

> 
> Regards,
> Torsten
> 
> 
> -------- Original-Nachricht --------
>> Datum: Wed, 17 Oct 2007 11:32:42 +0200
>> Von: Olaf Meske <om...@softcare.de>
>> An: Maven Users List <us...@maven.apache.org>
>> Betreff: How to setup repeatable builds with maven or how to tag dependencies
> 
>> Hi All,
>>
>> I'm a beginner of Maven and I'm doing some research if we could use 
>> maven for some of our projects.
>> One thing that we really need, is to repeat our builds from the tagged 
>> versions from the cvs/svn with the exact same result. But I understand 
>> that maven will get the newest matching version of any dependency on 
>> every run.
>>
>> So all I'll can think to get this to work are these following ways:
>>
>> 1.) To check-in ALL dependencies into a local maven repository and this 
>> maven repository into the cvs/svn, but with this this approach I'll lost 
>> the possibility to use any 3rd party maven proxy to handle the external 
>> dependencies and I really have to get and check-in every external 
>> dependency by myself.
>>
>> OR
>>
>> 2.) To check-in every assembly into the cvs/svn repository and to tag 
>> this assembly. But with this is double the source of every snapshot 
>> within the cvs/svn and I'll lost much of the project internal history 
>> and dependencies (with the assembly I'll not be able to step through the 
>> history of any source files, because I duplicated it).
>>
>> OR
>>
>> 3.) To used fixed versions with the dependencies and no range or 
>> matching versions. But with this I'll lost some of the main features of 
>> maven, to solve the dependencies between the dependencies.
>>
>> Are there any other ways to setup maven projects to get repeatable 
>> builds with dependencies?
>>
>>
>> Olaf
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 


-- 

Olaf Meske
Senior Software Engineer

SoftCare Software-Service GmbH
Kieler Straße 103
25474 Bönningstedt
Germany

PHONE +49 (0) 40 55 69 50-33
FAX +49 (0) 40 55 69 50-50
EMAIL omeske@softcare.de
WEB www.softcare.de

Based in: Kieler Straße 103, 25474 Bönningstedt, Germany
Register court: Amtsgericht Pinneberg, HRB 4086
Managing Directors: Marion Schrader, Andreas Schrader

+++ Manage any Content. Serve all Media. Cross-media publishing with 
SoftCare K4. +++

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


Re: How to setup repeatable builds with maven or how to tag dependencies

Posted by Torsten Schlabach <TS...@gmx.net>.
Hi Olaf,

just to help me understand:

Am I assuming right that

- some of your dependencies are external to your project and some of them are internal, i.e. different parts (modules) of your project which move at different speed in terms of SCM?

- your internal dependencies are setup using -SNAPSHOT as an alias for "always the latest"?

In case my assumptions would be right, would it then help you if you'd record just a map of the exact timestamps used in a given build and have a facility to let Maven pick up just that versions when trying to build again?

Regards,
Torsten


-------- Original-Nachricht --------
> Datum: Wed, 17 Oct 2007 11:32:42 +0200
> Von: Olaf Meske <om...@softcare.de>
> An: Maven Users List <us...@maven.apache.org>
> Betreff: How to setup repeatable builds with maven or how to tag dependencies

> Hi All,
> 
> I'm a beginner of Maven and I'm doing some research if we could use 
> maven for some of our projects.
> One thing that we really need, is to repeat our builds from the tagged 
> versions from the cvs/svn with the exact same result. But I understand 
> that maven will get the newest matching version of any dependency on 
> every run.
> 
> So all I'll can think to get this to work are these following ways:
> 
> 1.) To check-in ALL dependencies into a local maven repository and this 
> maven repository into the cvs/svn, but with this this approach I'll lost 
> the possibility to use any 3rd party maven proxy to handle the external 
> dependencies and I really have to get and check-in every external 
> dependency by myself.
> 
> OR
> 
> 2.) To check-in every assembly into the cvs/svn repository and to tag 
> this assembly. But with this is double the source of every snapshot 
> within the cvs/svn and I'll lost much of the project internal history 
> and dependencies (with the assembly I'll not be able to step through the 
> history of any source files, because I duplicated it).
> 
> OR
> 
> 3.) To used fixed versions with the dependencies and no range or 
> matching versions. But with this I'll lost some of the main features of 
> maven, to solve the dependencies between the dependencies.
> 
> Are there any other ways to setup maven projects to get repeatable 
> builds with dependencies?
> 
> 
> Olaf
> 
> 
> ---------------------------------------------------------------------
> 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