MPANT-25: Add a new goal (ant:execute) to execute a build.xml file from maven.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@405217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2006-05-08 23:14:54 +00:00
parent e79f2d0e86
commit f010fba57a
5 changed files with 51 additions and 9 deletions

View File

@ -48,4 +48,23 @@
<ant:echo>${maven.ant.generatebuild.file} generated.</ant:echo>
</goal>
<goal
name="ant:execute"
description="Execute an Ant build file">
<ant:echo>Executing ${maven.ant.execute.dir}/${maven.ant.execute.script} ...</ant:echo>
<ant:ant>
<j:if test="${context.getVariable('maven.ant.execute.script') != null and !context.getVariable('maven.ant.execute.script').equals('')}">
<ant:setProperty name="antfile" value="${context.getVariable('maven.ant.execute.script')}" />
</j:if>
<j:if test="${context.getVariable('maven.ant.execute.dir') != null and !context.getVariable('maven.ant.execute.dir').equals('')}">
<ant:setProperty name="dir" value="${context.getVariable('maven.ant.execute.dir')}" />
</j:if>
<j:if test="${context.getVariable('maven.ant.execute.target') != null and !context.getVariable('maven.ant.execute.target').equals('')}">
<ant:setProperty name="target" value="${context.getVariable('maven.ant.execute.target')}" />
</j:if>
</ant:ant>
<ant:echo>${maven.ant.execute.dir}/${maven.ant.execute.script} executed.</ant:echo>
</goal>
</project>

View File

@ -21,7 +21,12 @@
# keep them apart from the project specific properties.
# -------------------------------------------------------------------
maven.ant.execute.script = build.xml
maven.ant.execute.dir = ${basedir}
maven.ant.execute.target =
maven.ant.generatebuild.file = ${basedir}/build.xml
maven.ant.use.properties = true
maven.ant.compatibility = 1.6
maven.ant.use.properties = true
maven.ant.use.multirepo = true

View File

@ -19,9 +19,9 @@
<goal name="testPlugin" prereqs="test-ant"/>
<goal name="test-ant" prereqs="clean">
<delete file="${basedir}/build.xml" failonerror="false"/>
<attainGoal name="ant"/>
<attainGoal name="ant:generate-build"/>
<assert:assertFileExists file="${basedir}/build.xml"/>
<ant:ant/>
<attainGoal name="ant:execute"/>
<!-- load build.xml file and check that 'target' property is relative -->
<u:file name="${basedir}/build.xml" var="buildFile"/>
<x:parse var="buildXml" xml="${buildFile.toURL()}"/>

View File

@ -26,11 +26,8 @@
</properties>
<body>
<release version="1.10-SNAPSHOT" date="In SVN">
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated :
<ul>
<li>commons-jelly-tags-xml v1.0 -> v1.1</li>
</ul>
</action>
<action dev="aheritier" type="add" issue="MPANT-25">Add a new goal (ant:execute) to execute a build.xml file from maven.</action>
<action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated : commons-jelly-tags-xml v1.0 to v1.1.</action>
</release>
<release version="1.9" date="2005-04-09">
<action dev="aheritier" type="add" issue="MPANT-24">Ant script looks for dependencies in several remote repositories.</action>

View File

@ -67,10 +67,31 @@
<tr>
<td>maven.ant.use.multirepo</td>
<td>Defines if you want to generate a script which will download dependencies from all your repositories. If false, the script will only download them from the first one (ibiblio by default).</td>
<td>since 1.9</td>
<td>since 1.10</td>
<td>Yes</td>
<td>true</td>
</tr>
<tr>
<td>maven.ant.execute.script</td>
<td>The buildfile to use. Defaults to "build.xml". This file is expected to be a filename relative to the "maven.ant.execute.dir" property given.</td>
<td>since 1.10</td>
<td>Yes</td>
<td>"build.xml"</td>
</tr>
<tr>
<td>maven.ant.execute.dir</td>
<td>The directory to use as a basedir for the Ant project. Defaults to the current project's basedir. This will override the basedir setting of the called project.</td>
<td>since 1.10</td>
<td>Yes</td>
<td>${basedir}</td>
</tr>
<tr>
<td>maven.ant.execute.target</td>
<td>The target of the Ant project that should be executed. Defaults to the project's default target.</td>
<td>since 1.9</td>
<td>Yes</td>
<td><i>&lt;empty&gt;</i></td>
</tr>
</table>
</section>
</body>