I am not an expert on this, but it might be worth checking again since
only last week we moved from loading global.properties as ant
properties to loading them as maven properties. If I understand
Jason's post correctly this would be a prerequisite for his recommended
methods working.
david jencks
On Oct 17, 2004, at 10:13 AM, Dain Sundstrom wrote:
We have two execution scenarios. The most common is from a reactor
(multiproject) build, where we could use property inheritance. The
second is directly from the module. The problem I found in the second
scenario is it appears that the dependencies are verified (downloaded)
before our maven code that loads the global properties file is
executed. I have been thinking about this for a while, and think the
easiest solution would be to have maven load a project.properties file
from the directory of the parent project.xml file before verifying
(downloading) dependencies. The reason we use entities is because it
was the only thing that worked in both scenarios.
-dain
--
Dain Sundstrom
Chief Architect
Gluecode Software
310.536.8355, ext. 26
On Oct 17, 2004, at 8:30 AM, Jason van Zyl wrote:
Hi,
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.
--
jvz.
Jason van Zyl
[EMAIL PROTECTED]
http://maven.apache.org
happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will
come
and sit softly on your shoulder ...
-- Thoreau