2011-08-04 142 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 –