You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by cause <ca...@live.ru> on 2008/12/16 22:17:27 UTC
setting ant attribute with value from pom
Hello,
I'm having problem setting ant attribute with a property passed from pom
file.
Here is the pom part where I call ant target:
<ant antfile="build.xml" target="update-dependencies-in-shared-repository">
<property name="shared-repo"
value="${shared.repository}"/>
</ant>
Here is the ant file:
<project name="Update Shared Repository"
default="update-dependencies-in-shared-repository"
xmlns:artifact="urn:maven-artifact-ant">
<path id="maven-ant-tasks.classpath"
path="lib/maven-ant-tasks-2.0.9.jar"/>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath"/>
<target name="update-dependencies-in-shared-repository">
<echo>${shared-repo}</echo>
<artifact:dependencies filesetId="dependency.fileset">
<artifact:pom id="maven.project" file="pom.xml"/>
<artifact:localRepository path="${shared-repo}"/>
</artifact:dependencies>
</target>
</project>
I'm interested in using ${shared-repo} parameter, but although echo prints
the correct value of this parameter, it doesn't set localRepository path
(and default is used instead).
Hope my problem is clear and not too stupid :). Any help would be
appreciated.
Thanks
--
View this message in context: http://www.nabble.com/setting-ant-attribute-with-value-from-pom-tp21042019p21042019.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: setting ant attribute with value from pom
Posted by SamehAnsary <sa...@gmail.com>.
Well my first shot at this is that you are embedding "artifact:pom"
inside "artifact:dependencies". The correct way is:
<!-- This loads the POM -->
<artifact:pom id="maven.project" file="pom.xml" />
<!-- This loads stuff from the POM -->
<artifact:dependencies pathId="dependency.classpath">
<pom refid="maven.project" />
</artifact:dependencies>
--
View this message in context: http://www.nabble.com/setting-ant-attribute-with-value-from-pom-tp21042019p21049065.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org