2012-08-03 70 views
0

我需要使用子項目來構建項目,而主項目是Maven項目,其中一個子項目 - 是Ant項目。 我需要編譯一個主要pom.xml中的所有項目 我找到了解決方案How to wrap an Ant build with Maven?,它的答案是正確的,但不適合我的項目。因爲當我需要螞蟻項目的Ant訴1.8.x的,但在與如何使用Maven v。2.x打包Ant v.1.8.1版本?

<dependencies> 
     <dependency> 
      <groupId>ant-contrib</groupId> 
      <artifactId>ant-contrib</artifactId> 
      <version>1.0b3</version> 
      <exclusions> 
       <exclusion> 
        <groupId>ant</groupId> 
        <artifactId>ant</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.ant</groupId> 
      <artifactId>ant-nodeps</artifactId> 
      <version>1.8.1</version> 
     </dependency> 
    </dependencies> 

    <modules> 
     <module>Bundles/I_AboutForm</module> 
     <module>Bundles/I_AppVars</module> 
    </modules> 


    <build> 
     <plugins> 
      <plugin> 
       <artifactId>maven-antrun-plugin</artifactId> 
       <executions> 
        <execution> 
         <phase>process-resources</phase> 
         <configuration> 
          <!--<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath" />--> 
          <tasks> 
           <ant antfile="MainApplication/build.xml" target="compile"/> 
          </tasks> 
         </configuration> 
         <goals> 
          <goal>run</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

Maven構建下載螞蟻訴1.7.1,並使用他的版本(在當地回購有Ant v.1.8.1 )。 我認爲,在ant-contrib 1.0b3的依賴中可能會遇到麻煩 - 可能是ant-contrib依賴於Ant v。1.7.1嗎?

請指教我如何在Maven中構建Ant v。1.8.x項目。 謝謝,最好的問候,亞瑟。

回答