You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Russell Gold <ru...@oracle.com> on 2007/07/10 21:41:23 UTC

Can Maven do this?

I have a complex of projects that I want to manage. Essentially, it 
consists of a number of "master" projects, each of which in turn 
consists of a number of builds. A rule that I need to follow is that if 
any two builds refer to the same artifact, they must use the same 
version - even if they do not depend on each other, or are in separate 
master projects. If master project A picks up a new version of master 
project B, and one of the latter's builds has move to a new version of 
one of its dependencies, the next time I build master project A, any of 
its builds that uses that dependency must also move to the new version.

Now, I know of a way to do this using custom ant tasks and a new form of 
configuration file for the master project - but I would prefer not to 
re-invent the wheel if Maven already has a solution (or if not, is it a 
capability that Maven users would like...?)

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


Re: Can Maven do this?

Posted by "Alan D. Salewski" <as...@healthmarketscience.com>.
On Wed, Jul 11, 2007 at 08:35:02AM -0400, Russell Gold spake thus:
> Alan D. Salewski wrote:
> >Sure, maven can do this. In fact, any project that contains multiple
> >subprojects (which would include any project that produces more than a
> >single artifact) is probably organized to take advantage of the feature.
> >
> >Basically, you declare your common dependencies (specifying version
> >numbers, etc) in the 'dependencyManagement' section of a pom.xml file
> >that your subproject builds reference as their "parent" (and override
> >settings as necessary). The subproject builds declare their dependencies
> >in the 'dependencies' section of their pom.xml files, and get the
> >version specified in the parent pom.xml.
> >
> >Google for 'dependencyManagement', and you should find everything you
> >need to get this going.
> >  
> Sounds very promising. But this does not appear to be implemented by the 
> 'ant tasks for maven' which is what I am using at present (conversion of 
> all of our ant scripts to maven is likely to take a long time). Any 
> clues on how I would go about adding the support?

Sorry, but I have not used the 'ant tasks for maven', and am not
familiar with it. The website[0] looks like it may have the answer; this
is a quote from the "Using the Antlib" section of the site:

    "The main purpose of the antlib is to utilise Maven's dependency
     management features."

If you do not find what you need there, maybe ask on this list in a new
thread with a more specific subject and someone else will be able to
help.

-Al

[0] http://maven.apache.org/ant-tasks.html

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

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


Re: Can Maven do this?

Posted by Russell Gold <ru...@oracle.com>.
Alan D. Salewski wrote:
> Sure, maven can do this. In fact, any project that contains multiple
> subprojects (which would include any project that produces more than a
> single artifact) is probably organized to take advantage of the feature.
>
> Basically, you declare your common dependencies (specifying version
> numbers, etc) in the 'dependencyManagement' section of a pom.xml file
> that your subproject builds reference as their "parent" (and override
> settings as necessary). The subproject builds declare their dependencies
> in the 'dependencies' section of their pom.xml files, and get the
> version specified in the parent pom.xml.
>
> Google for 'dependencyManagement', and you should find everything you
> need to get this going.
>   
Sounds very promising. But this does not appear to be implemented by the 
'ant tasks for maven' which is what I am using at present (conversion of 
all of our ant scripts to maven is likely to take a long time). Any 
clues on how I would go about adding the support?

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


Re: Can Maven do this?

Posted by "Alan D. Salewski" <as...@healthmarketscience.com>.
On Tue, Jul 10, 2007 at 03:41:23PM -0400, Russell Gold spake thus:
> I have a complex of projects that I want to manage. Essentially, it 
> consists of a number of "master" projects, each of which in turn 
> consists of a number of builds. A rule that I need to follow is that if 
> any two builds refer to the same artifact, they must use the same 
> version - even if they do not depend on each other, or are in separate 
> master projects. If master project A picks up a new version of master 
> project B, and one of the latter's builds has move to a new version of 
> one of its dependencies, the next time I build master project A, any of 
> its builds that uses that dependency must also move to the new version.
> 
> Now, I know of a way to do this using custom ant tasks and a new form of 
> configuration file for the master project - but I would prefer not to 
> re-invent the wheel if Maven already has a solution (or if not, is it a 
> capability that Maven users would like...?)


Sure, maven can do this. In fact, any project that contains multiple
subprojects (which would include any project that produces more than a
single artifact) is probably organized to take advantage of the feature.

Basically, you declare your common dependencies (specifying version
numbers, etc) in the 'dependencyManagement' section of a pom.xml file
that your subproject builds reference as their "parent" (and override
settings as necessary). The subproject builds declare their dependencies
in the 'dependencies' section of their pom.xml files, and get the
version specified in the parent pom.xml.

Google for 'dependencyManagement', and you should find everything you
need to get this going.

HTH,
-Al

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

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