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?

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.

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?

Thanks,

--jason


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



Reply via email to