On Fri, 2003-08-15 at 00:30, Jason Dillon wrote:
> 
> Specifically I was looking for a way to define common dependencies for 
> a large project (Apache Geronimo) so I could better manage version 
> numbers of the dependencies.  I did not wish to put all of the depends 
> into a parent project as that would force each child project to have 
> additional dependencies on its classpath which might not be a good 
> thing, nor do I want each and every module to try to download 
> SNAPSHOTS, especially if they do not even need that depend.
> 
> So I thought about using properties like 
> 'dependency.commons-logger.version=1.0.3' and then specify the property 
> as the content for <version/>, which works fine if the property is 
> defined in the child modules project.properties, or if the property is 
> in the parent and the child is always invoked through the reactor.  
> This is not the case with Geronimo, so this method fails.

I've done this - as you've probably found, at the moment you can't
inherit the contents of project.properties along with the project.xml
that you extend, so <extend> doesn't give you a mechanism for pulling in
shared property values. Similarly you can't use maven.xml (which is a
jelly script) because it's not parsed until after the POM has been
completely processed. You can set property values in maven.xml but they
aren't available at the time interpolation is performed on the POM. And
you can't put jelly into the POM as it's not a jelly script.

What I've done is store the properties in a text file and then have each
developer add the contents of that file to ~/build.properties. It's not
exactly a clean approach, and you need to make sure that you keep
~/build.properties in sync with the stuff in the source tree, but it
does work. I guess it should be possible to write some code in maven.xml
to check that the defined properties from ~/build.properties match thos
in the file in the source tree. And it seems there's a good chance of
being able to move the information into the parent project's
project.properties file in the future when <extend> inherits property
settings too, so eventually the hack can go away.

-Mark.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to