You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Erik Husby <mh...@broad.mit.edu> on 2004/02/19 22:59:31 UTC

Using Maven for development and production builds.

Perhaps someone can point me at some documentation that I've missed that 
deals with structuring interrelated projects for development and production.

At the moment, I have a large system that is built with Ant that I'd 
like to move to Maven and I am not sure how I should structure my 
project.xml and maven.xml files.  The system looks like this:

root
   subprojectA -- no dependencies -- produces a jar.
   subprojectB -- depends on subprojectA -- produces a jar.
   subprojectC -- depends on subprojectA and SubprojectB -- produces a jar.
   subprojectD -- depends on A, B, and C. produces a jar, and a war 
depending on deployment options.
 

Right now developers checkout the complete source tree and do a master 
build. They can also do subproject builds because each subproject knows 
its dependencies. I'd like them to be able to only check out the 
subproject that they are working on and have their build pickup the 
latest jars from the nightly build.

The goals I want to have are:

1. Nightly build is triggered by changes in CVS. Result of the nightly 
build will be updated jar files in the local repository. Currently using 
Anthill for this and I have an Ant script that runs maven since the 
current Anthill calls Ant directly. This Nightly build would also create 
the internal site.

2. Developer builds should fetch updated jars from the local repository 
if necessary.

3. A Production release build that produces jars named with the label 
used to label the sources in CVS.

4. A production release goal that takes the results of goal 3, creates a 
distribution where the labels have been removed from the jars so that 
the scripts that run some of the applications can hardwire their 
classpaths as opposed to building them dynamicly.

I think I understand that I can use the SNAPSHORT attribute to get the 
first 2 goals but I am unclear on the procedure needed for goals 3 and 4.

Any advice on this topic.

-- 
Erik Husby
Team Lead for Software Quality Automation
Genome Center at MIT
Rm. 2192
320 Charles St
Cambridge, MA 02141-2023
mobile: 781.354.6669
office: 617.258.9227
mhusby@broad.mit.edu



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


Re: Using Maven for development and production builds.

Posted by Erik Husby <mh...@broad.mit.edu>.
I am certainly willing to contribute once I understand.

One thing I did learn the other day is that I can use a variable in the 
project.xml in the jar dependency which can be set at build time. That 
is one way to switch between SNAPSHOT and release mode. But Maven's use 
of property files does not appear as flexible as Ant, i.e., the 
hierarchy is built in and I don't know yet how to work around it. For 
instance, in my Ant files, I've recently adopted the convention of:

<property name="app.name" value="MyProject"/>
 <property name="properties.dir" location="${user.home}"/>
<property file="${properties.dir}/${app.name}_build.properties"/>

This gives me an extra level of indirection and control that I needed 
when I wanted to use the same account on different platforms with a 
shared file system to build different versions of my projects. Perhaps 
one can do something similar in the maven.xml file, I don't know yet.

-- 
Erik Husby
Team Lead for Software Quality Automation
Genome Center at MIT
Rm. 2192
320 Charles St
Cambridge, MA 02141-2023
mobile: 781.354.6669
office: 617.258.9227
mhusby@broad.mit.edu



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


Re: Using Maven for development and production builds.

Posted by "Jeffrey D. Brekke" <jb...@wi.rr.com>.
We are in the same situation, but with more projects.  I'm wrestling
our build and testing stuff into maven now and release vs. snapshot
artifacts are next.  Maybe we could start up a page on the maven wiki
listing best practices in this regard or something?

>>>>> On Thu, 19 Feb 2004 16:59:31 -0500, Erik Husby <mh...@broad.mit.edu> said:

> Perhaps someone can point me at some documentation that I've missed
> that deals with structuring interrelated projects for development
> and production.

> At the moment, I have a large system that is built with Ant that I'd
> like to move to Maven and I am not sure how I should structure my
> project.xml and maven.xml files.  The system looks like this:

> root subprojectA -- no dependencies -- produces a jar.  subprojectB
> -- depends on subprojectA -- produces a jar.  subprojectC -- depends
> on subprojectA and SubprojectB -- produces a jar.  subprojectD --
> depends on A, B, and C. produces a jar, and a war depending on
> deployment options.
 

> Right now developers checkout the complete source tree and do a
> master build. They can also do subproject builds because each
> subproject knows its dependencies. I'd like them to be able to only
> check out the subproject that they are working on and have their
> build pickup the latest jars from the nightly build.

> The goals I want to have are:

> 1. Nightly build is triggered by changes in CVS. Result of the
> nightly build will be updated jar files in the local
> repository. Currently using Anthill for this and I have an Ant
> script that runs maven since the current Anthill calls Ant
> directly. This Nightly build would also create the internal site.

> 2. Developer builds should fetch updated jars from the local
> repository if necessary.

> 3. A Production release build that produces jars named with the
> label used to label the sources in CVS.

> 4. A production release goal that takes the results of goal 3,
> creates a distribution where the labels have been removed from the
> jars so that the scripts that run some of the applications can
> hardwire their classpaths as opposed to building them dynamicly.

> I think I understand that I can use the SNAPSHORT attribute to get
> the first 2 goals but I am unclear on the procedure needed for goals
> 3 and 4.

> Any advice on this topic.

> -- Erik Husby Team Lead for Software Quality Automation Genome
> Center at MIT Rm. 2192 320 Charles St Cambridge, MA 02141-2023
> mobile: 781.354.6669 office: 617.258.9227 mhusby@broad.mit.edu



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

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com


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