geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <fer...@frii.com>
Subject Re: Using entities to manage dependency versions
Date Sun, 17 Oct 2004 16:00:14 GMT
Jason van Zyl wrote:

> I noticed Bruce's blog entry about the use of entities and I just wanted
> to suggest the approach that was intended for use. Entities started
> being used because of some defects in the inheritance mechanism. The way
> I have always used for integration across builds has been this way:
> 
> http://maven.apache.org/reference/user-guide.html#Overriding_Stated_Dependencies
> 
> You guys use a parent POM for everything, and you might have tried this
> but I think this might not be working for you because of the way you
> pull in your global properties. I haven't look at your build lately but
> I think you are using an ant task to pull in your global properties
> which doesn't make its way into the inheritance mechanism.
> 
> You should be able to put everything in your global.properties file in
> the project.properties file in your /etc directory and then the
> inheritance mechanism will kick in. Currently there are three ways
> people use for managing dependency versions:
> 
> o using the JAR override mechanism
> o using properties files with stating versions and using interpolation
> o using entities
> 
> I would definitely recommend using one of the first two. I want to
> promote native mechanisms in Maven itself for dealing with these things.
> There were problems with inheritance which is why people resorted to
> using entities: I saw that blog entry on your use of entities and
> cringed. That's definitely not something I want to promote as a best
> practice. I am primarily working on m2 but I double checked with Brett
> and he tells me the inheritance problems have been fixed. 
> 
> I don't believe the first two methods would have worked for you because
> of the use of the ant:property tag, but if you tried using the standard
> form of inheritance I think you could actually use what's recommended.
> 
> If you have actually it without the ant:property task and it doesn't
> work then it's a bug and needs to be fixed but people have been
> reporting that inheritance generally works now in m1.

The main reason I began using the entity solution was because I could 
not get the property inheritance working at all. However, upon further 
investigation by my friend Jeff Genender, it appears that all the 
properties I had specified when trying to get inheritance working 
contained a hyphen. Evidently Maven tries to do arithmetic on anything 
with a hyphen. If I replace the hyphen in the property names with an 
underscore, property inheritance works like it should. Unfortunately it 
took a *lot* of experimentation to figure this out. This *really, 
really* should be documented on the Maven site. This subtlty hung me up 
for quite a long while. Having had this documented in the Maven FAQ is a 
good start. Of course, I haven't looked at the Maven docs lately, maybe 
it's already there.

BTW, I have used the maven.jar.override property in the past, but only 
to point to jars in a project's lib directory.

Thanks for chiming in on this, Jason.

Bruce
-- 
perl -e 'print 
unpack("u30","<0G)U8V4\\@4VYY9&5R\\"F9E<G)E=\\$\\!F<FEI+F-O;0\\`\\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

Mime
View raw message