maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Taylor" <>
Subject Accessing properties in Maven that are set in Ant subbuilds?
Date Sun, 09 Jan 2005 12:59:52 GMT
Does anyone know if it's possible to access properties defined in calls to 
Ant from Maven?  Ant seems to see Maven's properties perfectly well, but not 
vice versa

For example
in my maven.xml

<property name="mymaven.prop" value="hello"/>
<goal name="foo">
    <ant target = "bar" dir="." antfile="build.xml"/>
     <echo message="Ant property ${myant.prop}"/>

and in the build.xml in the same directory:

<target name="bar">
    <echo>Maven property: ${mymaven.prop}</echo>
    <property name="myant.prop" value="world"/>

Only $mymaven.prop gets echoed.

I suspect this might actually be an Ant feature (properties in a master 
build are visible to sub-builds but not vice versa), but you never know - 
there might be some clever and Mavenish way to get round it.


John Taylor
Astrogrid Java Developer
Royal Observatory of Edinburgh
+44 (0) 131 668 8329
skype id: johndavidtaylor

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message