maven 调用ant task的配置

1、在maven中调用ant的task,利用maven的antrun的plugin:maven-antrun-plugin。配置的例子如下:

<?xml version="1.0" encoding="UTF-8"?>
   <project> 
     <modelVersion>4.0.0</modelVersion> 
     <artifactId>TestRCP</artifactId> 
     <groupId>TestRCP</groupId> 
     <version>1.0-SNAPSHOT</version> 
    <packaging>pom</packaging> 
   <name>ANT</name> 
     <build> 
       <plugins> 
         <plugin> 
           <artifactId>maven-antrun-plugin</artifactId> 
           <executions> 
             <execution> 
               <phase>generate-sources</phase> 
               <configuration> 
                 <tasks> 
                   <ant antfile="./build.xml" /> 
                 </tasks> 
               </configuration> 
               <goals> 
                 <goal>run</goal> 
               </goals> 
             </execution> 
           </executions> 
         </plugin> 
       </plugins> 
     </build> 
   </project> 

就可以调用ant的task了。 

当调用多个ant配置是如下:

                <tasks> 
                   <ant antfile="./build-server.xml" /> 
                   <ant antfile="./build-client.xml"/>
                   <ant antfile="./build-fgosnewweb.xml"/>
                   <ant antfile="./build-interface.xml"/>
                 </tasks> 

你可能感兴趣的:(maven,xml,ant)