You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matthew Jaskula <mj...@nyx.com> on 2008/12/03 16:07:59 UTC

How can maven be used in a continuous integration situation?

This question has also been posted to stackoverflow.com:

http://stackoverflow.com/questions/335781/how-can-maven-be-used-in-a-continu
ous-integration-situation-to-install-versione

--

We are in the process of converting our main build process from ant to
maven. We use TeamCity for our Continuous Integration server (CI).

We'd like to use the CI server to kick off (nightly) builds whose version
contain a build number, as in 1.0.0.build#. These builds would be installed
in our local maven repository to be used by other projects. So the CI server
would manage the versions, maven would build the project, and the maven
repository would make the builds accessible to other projects.

I intended to initiate the build from the CI server using the following
command:

    mvn -Dversion=1.0.0.25 install

The project's pom would have a bogus version number, and the -D flag would
override it, as in:

    <version>0.0.0.0</version>


The problem with this method is that the maven install plugin only uses the
version in the pom file, not the version passed in on the command line. This
is noted in [this maven issue][1].

So since this issue has existed since 08/2006 and has not been fixed, I
assume that this is somehow not '*the maven way*'. So my question is, how
can maven be used in a continuous integration situation to install versioned
artifacts in the repository?

  [1]: http://jira.codehaus.org/browse/MINSTALL-30


Thank you.


Matthew Jaskula
Engineer
Advanced Trading Solutions
NYSE Euronext
22 Cortlandt Street, Suite 1101
New York, New York 10007
United States
t +1 212.542.8299
www.nyseeuronext.com



Visit our website at http://www.nyse.com

****************************************************

Note:  The information contained in this message and any attachment
to it is privileged, confidential and protected from disclosure.  If the 
reader of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify the 
sender immediately by replying to the message, and please delete
it from your system. Thank you.  NYSE Euronext, Inc.

Re: How can maven be used in a continuous integration situation?

Posted by Kent Närling <ke...@seamless.se>.
Well, first of all, maybe you should get a CI server? (unless you have one?)I
would recommend continuum
(http://continuum.apache.org)<http://continuum.apache.org/> at
least to get started and then things will probably clear up...

No, usually the CI server does not generate releases every night, it usually
does deploy (but this is configurable in continuum) on the project which
will uploade the snapshot to the snapshot repository.
A remark, here: continuuum only generates a build if there are any
changes... and it checks for changes regularly (by default hourly)


2008/12/4 Matthew Jaskula <mj...@nyx.com>

> Are you suggesting that our CI server performs a 'mvn release' nightly?
> From
> the documentation that you linked to it seems like this is not intended to
> be an automated process, as there are several steps that prompt the user
> for
> information. I assume that you can provide this information on the command
> line?
>
> Regardless of this issue, what is standard practice in this situation? We
> want a CI server to use maven to produce regular versioned builds of a
> project that is a dependency of other projects. Is there something about
> this that doesn't fin in the maven philosophy?
>
> Thanks.
>
> Matthew Jaskula
> t +1 212.542.8299
>
>
> > From: Wayne Fay <wa...@gmail.com>
> > Reply-To: Maven Users List <us...@maven.apache.org>
> > Date: Wed, 3 Dec 2008 16:35:01 -0800
> > To: Maven Users List <us...@maven.apache.org>
> > Subject: Re: How can maven be used in a continuous integration situation?
> >
> >> The problem with this method is that the maven install plugin only uses
> the
> >> version in the pom file, not the version passed in on the command line.
> This
> >> is noted in [this maven issue][1].
> >
> > If you use "mvn release" rather than simply "mvn install", this is
> > handled for you via the release plugin. Since you are literally
> > "cutting a release", I think this is appropriate anyway.
> >
> > "mvn install" only installs the artifacts in the local repo cache.
> > "mvn release" does a lot more.
> >
> > You probably want to use the batch mode:
> > http://maven.apache.org/plugins/maven-release-plugin/howto.html
> >
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
>
> Visit our website at http://www.nyse.com
>
> ****************************************************
>
> Note:  The information contained in this message and any attachment
> to it is privileged, confidential and protected from disclosure.  If the
> reader of this message is not the intended recipient, or an employee
> or agent responsible for delivering this message to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify the
> sender immediately by replying to the message, and please delete
> it from your system. Thank you.  NYSE Euronext, Inc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Kent Närling

System Architect
SEAMLESS
Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
Phone: +46 8 5648 7800, fax: +46 8 5648 7823
Mobile: +46 70 836 9925
Mail: kent.narling@seamless.se
www.seamless.se

Re: How can maven be used in a continuous integration situation?

Posted by John Stoneham <ly...@lyrically.net>.
On Thu, Dec 4, 2008 at 10:29 AM, Matthew Jaskula <mj...@nyx.com> wrote:
> Are you suggesting that our CI server performs a 'mvn release' nightly? From
> the documentation that you linked to it seems like this is not intended to
> be an automated process, as there are several steps that prompt the user for
> information. I assume that you can provide this information on the command
> line?

There is a batch mode in the release plugin - see
http://maven.apache.org/plugins/maven-release-plugin/howto.html . You
could do a release:prepare/perform, or release:prepare/stage. You
would probably want to use a profile that sets autoVersionSubmodules
and configures the developmentVersion and releaseVersion parameters.

I kind of wish there was a way to do this WITHOUT committing and doing
the tag somehow. You might have to do it by hand. Maybe a new plugin?

- John

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


Re: How can maven be used in a continuous integration situation?

Posted by Baptiste MATHUS <ml...@batmat.net>.
The latter, look at the link Wayne provided (maven-release-plugin).

Cheers.

2008/12/4 Martin Höller <ma...@xss.co.at>

> On Thursday 04 December 2008 Wayne Fay wrote:
> > > The problem with this method is that the maven install plugin only uses
> > > the version in the pom file, not the version passed in on the command
> > > line. This is noted in [this maven issue][1].
> >
> > If you use "mvn release" rather than simply "mvn install", this is
> > handled for you via the release plugin. Since you are literally
> > "cutting a release", I think this is appropriate anyway.
>
> What is "mvn release"? According to [0] it's not a valid phase or
> lifecylce. And running it gives me
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Invalid task 'release': you must specify a valid lifecycle phase, or
> a
> goal in the format plugin:goal or
> pluginGroupId:pluginArtifactId:pluginVersion:goal
>
> Do you mean "mvn deploy"? Or do you mean using the release plugin
> like "mvn release:prepare release:perform"?
>
> regards,
> - martin
>
> [0]
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: How can maven be used in a continuous integration situation?

Posted by Martin Höller <ma...@xss.co.at>.
On Thursday 04 December 2008 Wayne Fay wrote:
> > The problem with this method is that the maven install plugin only uses
> > the version in the pom file, not the version passed in on the command
> > line. This is noted in [this maven issue][1].
>
> If you use "mvn release" rather than simply "mvn install", this is
> handled for you via the release plugin. Since you are literally
> "cutting a release", I think this is appropriate anyway.

What is "mvn release"? According to [0] it's not a valid phase or
lifecylce. And running it gives me

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task 'release': you must specify a valid lifecycle phase, or a
goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal

Do you mean "mvn deploy"? Or do you mean using the release plugin
like "mvn release:prepare release:perform"?

regards,
- martin

[0] http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference

Re: How can maven be used in a continuous integration situation?

Posted by Matthew Jaskula <mj...@nyx.com>.
Are you suggesting that our CI server performs a 'mvn release' nightly? From
the documentation that you linked to it seems like this is not intended to
be an automated process, as there are several steps that prompt the user for
information. I assume that you can provide this information on the command
line?

Regardless of this issue, what is standard practice in this situation? We
want a CI server to use maven to produce regular versioned builds of a
project that is a dependency of other projects. Is there something about
this that doesn't fin in the maven philosophy?

Thanks.

Matthew Jaskula
t +1 212.542.8299


> From: Wayne Fay <wa...@gmail.com>
> Reply-To: Maven Users List <us...@maven.apache.org>
> Date: Wed, 3 Dec 2008 16:35:01 -0800
> To: Maven Users List <us...@maven.apache.org>
> Subject: Re: How can maven be used in a continuous integration situation?
> 
>> The problem with this method is that the maven install plugin only uses the
>> version in the pom file, not the version passed in on the command line. This
>> is noted in [this maven issue][1].
> 
> If you use "mvn release" rather than simply "mvn install", this is
> handled for you via the release plugin. Since you are literally
> "cutting a release", I think this is appropriate anyway.
> 
> "mvn install" only installs the artifacts in the local repo cache.
> "mvn release" does a lot more.
> 
> You probably want to use the batch mode:
> http://maven.apache.org/plugins/maven-release-plugin/howto.html
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 



Visit our website at http://www.nyse.com

****************************************************

Note:  The information contained in this message and any attachment
to it is privileged, confidential and protected from disclosure.  If the 
reader of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the intended 
recipient, you are hereby notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify the 
sender immediately by replying to the message, and please delete
it from your system. Thank you.  NYSE Euronext, Inc.


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


Re: How can maven be used in a continuous integration situation?

Posted by Wayne Fay <wa...@gmail.com>.
> The problem with this method is that the maven install plugin only uses the
> version in the pom file, not the version passed in on the command line. This
> is noted in [this maven issue][1].

If you use "mvn release" rather than simply "mvn install", this is
handled for you via the release plugin. Since you are literally
"cutting a release", I think this is appropriate anyway.

"mvn install" only installs the artifacts in the local repo cache.
"mvn release" does a lot more.

You probably want to use the batch mode:
http://maven.apache.org/plugins/maven-release-plugin/howto.html

Wayne

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