I can do this
run ANT build.xml from Maven using ant run plugin.
My pom.xml
<target>
<property name="src.dir" location="my_project_folder_location"/>
<subant>
<fileset dir="${src.dir}" includes="**/build.xml"/>
</subant>
</target>
This runs ANT with build.xml
<project name="*ant_test" basedir=".">
<copy overwrite="true" force="true" verbose="true" todir="to_folder">
<fileset dir="from_folder" />
</copy>
</project>
It does the task of copying from 1 folder to another.
What I need to do is:
Run this new build.xml with <target>.
<project name="*ant_test" basedir=".">
<target name="onlyCopy">
<copy overwrite="true" force="true" verbose="true" todir="to_folder">
<fileset dir="from_folder" />
</copy>
</target>
</project>
What changes should I make in the pom.xml
EDIT
The difference between this question and is:
In the ANT build.xml I have mentioned <targer>. Target allows independent tasks to be run by selecting the target name from ANT builtfire.
Basically what you are looking for is to Run ANT with all the targets without individually running each target.
You can simply add a target in subant of your
pom.xml<subant target="onlyCopy">will do the trick.