On Sun, 2003-03-02 at 15:49, Jason Dillon wrote: > Hello, I am trying to convince Maven to import properties from a > specific file (other than the defaults) but I am not having much luck > getting it to work well. I am trying to setup a common-project.xml, > common-maven.xml and common-project.properties to include, well common > bits, for a very large and possibly nested project (JBoss). I thought > I had it working with this in my maven.xml: > > <jelly-util:properties > file="${basedir}/../common-project.properties"/> > > common-project.properties simply contains (at the moment): > > maven.repo.local=${basedir}/../repository > maven.build.dir=${basedir}/output > > But when I run jar:install on a simple project I get unexpected results: > > <snip> > ... > java:prepare-filesystem: > [mkdir] Created dir: > /Users/jason/ws/testmaven/module-a/${basedir}/output/classes > ... > [mkdir] Created dir: > /Users/jason/ws/testmaven/module-a/repository/org.jboss.module.a > ... > </snip> > > It appears that in one place no substitution has been performed (thus > the ${basedir}) and then later substitution has been done which simply > converted '${basedir}' into ''. Neither of which is desired in this > case. > > So, is there a proper Maven-ish way to import properties? Or am I > stuck redefining common properties throughout the entire project? Note > I did consider using $MAVEN_HOME/project.properties but I did not want > all projects which use a shared copy of maven (as would be the case > with JBoss... living in the tools module) to be forced to use the same > set of global properties. > > It seems like the above should work, but I am guessing that Maven does > some special fluff with its properties similar to Ant?
I can certainly help and you should be able to perform the large nested build with what Maven provides already. I do them myself quite frequently. You need to define a parent project and you can then share properties and maven jelly files so that you don't have to duplicate anything. > Also while I am on importing, I mentioned that I want to import a > common-maven.xml (and actually I want to put the property import inside > of there to reduce code duplication). I noticed some very odd behavior > when using jelly:core's import. Is there anything special I need to do > to make this work correctly? At this point I do not have a really good > example like above... I seem to be getting lost in a haze of mad file > hacking. If you are using inheritance then Maven will pick up the parent's maven.xml file and properties. > Or perhaps there is a better mechanism inside of Maven (or Jelly which > is Maven happy) to include common functionality for a set of projects > which does not require adding files to MAVEN_HOME? If you point me to the CVS repositories I can lend you a hand. > Thanks, > > --jason > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- jvz. Jason van Zyl [EMAIL PROTECTED] http://tambora.zenplex.org In short, man creates for himself a new religion of a rational and technical order to justify his work and to be justified in it. -- Jacques Ellul, The Technological Society --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]