You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2005/09/01 19:39:33 UTC

Re: [m1] Conditional dependencies

From: "Jay H. Hartley" <ma...@jay.hartley.name>

> 2) Create two different "parent" project files, and have the "extends"
> parameter depend on a property:
>
> <project>
> <extends>${jsf.project.file}</extends>

Jay, this turned out to work *perfectly*!

project.properties:
  maven.shale.jsf.impl.default=myfaces

-project.xml
<extend>${maven.shale.jsf.impl.default}-project.xml</extend>

project.xml:
   <extend>${maven.shale.jsf.impl}-project.xml</extend>

And jsfri-project.xml or myfaces-project.xml declares dependencies on one 
JSF implementation or the other.

So you can either set
   maven.shale.jsf.impl = [myfaces | jsfri ]
or leave it out and let it default.

-- 
Wendy Smoak 


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


RE: [m1] Conditional dependencies

Posted by "Jay H. Hartley" <ja...@modius.com>.
Wendy,

> Jay, this turned out to work *perfectly*!

Glad to hear it, though I agree with Brett that it doesn't necessarily fall
in the category of "Best Practice". I'm glad to hear Maven 2 will do a
better job of dealing with this kind of issue.

One concern was having duplicate artifacts with the same name but different
contents. If you haven't already, you might consider using the same property
in the artifact ID:
<artfactId>myproject-${maven.shale.jsf.impl}</artifactId>.

You could also manipulate maven.final.name, I guess, but I think SNAPSHOT
builds already do this, so you could end up with conflicts if you did it in
the wrong place.

Similarly, you could sprinkle that property around in other places to cause,
for example, the site to deploy to a different location with a different
title and slightly different description.

Effectively you end up with two different object models that just happen to
share the same codebase.

Good luck,

Jay

-----Original Message-----
From: Wendy Smoak [mailto:java@wendysmoak.com] 
Sent: Thursday, September 01, 2005 10:40 AM
To: Maven Users List
Subject: Re: [m1] Conditional dependencies

From: "Jay H. Hartley" <ma...@jay.hartley.name>

> 2) Create two different "parent" project files, and have the "extends"
> parameter depend on a property:
>
> <project>
> <extends>${jsf.project.file}</extends>

Jay, this turned out to work *perfectly*!

project.properties:
  maven.shale.jsf.impl.default=myfaces

-project.xml
<extend>${maven.shale.jsf.impl.default}-project.xml</extend>

project.xml:
   <extend>${maven.shale.jsf.impl}-project.xml</extend>

And jsfri-project.xml or myfaces-project.xml declares dependencies on one
JSF implementation or the other.

So you can either set
   maven.shale.jsf.impl = [myfaces | jsfri ] or leave it out and let it
default.

--
Wendy Smoak 



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