2011-08-04 141 views
0

我正在嘗試使用Maven和Ant在eclipse中爲Java項目創建一個構建文件。但是,我無法使maven-ant-tasks依賴工作。任何人都可以幫我解決這個問題嗎?也許我的網址和文件是錯誤的。那就是:Maven-Ant依賴關係問題

<property name="maven.ant.dir" value="http://apache.hoxt.com/maven/binaries"/> 

    <property name="maven.ant.file" value="http://apache.hoxt.com/maven/binaries/maven-ant-tasks-2.1.3.jar"/> 
+0

你能後,你使用這些屬性的片段?還有什麼是你得到的錯誤? – Raghuram

+0

儘管我使用了內部的Maven存儲庫,但我能夠解決它。網絡中應該有另一個用於ant任務的應用程序。這就是我要找的。 – codix

回答

1

這裏的Maven的Ant任務是如何工作的

<project .. xmlns:artifact="antlib:org.apache.maven.artifact.ant"> 
    .. 
    <target name="retrieve" description="Retrieve dependencies using Maven"> 

    <artifact:dependencies filesetId="compile.fileset" useScope="compile"> 
     <pom file="${pom.dir}/pom.xml"/> 
    </artifact:dependencies> 

    <copy todir="${retrieve.dir}/compile"> 
     <fileset refid="compile.fileset" /> 
     <mapper type="flatten" /> 
    </copy> 
    .. 

文檔是here

+0

如何在WAR文件中包含檢索到的jar文件? –

+1

@ImranAli我不認爲我理解你的問題......我可以建議你看看與ANT「戰爭」任務相關的「lib」標記:http://ant.apache.org/manual/ Tasks/war.html –

+0

感謝您的回覆。我想在WAR文件中包含Maven依賴項jar庫。檢查此:http://stackoverflow.com/questions/25902727/how-to-include-maven-dependency-libraries-in-war-file-using-ant-build –