[英]Resolve ivy dependencies from another project in build.xml
Disclaimer: I am a newbie using Ant + Ivy 免责声明:我是使用Ant + Ivy的新手
I have the following eclipse configuration : 我有以下Eclipse配置:
ProjectA depends on ProjectB and ProjectC ProjectA取决于ProjectB和ProjectC
ProjectB depends on ProjectC ProjectB取决于ProjectC
Each project has its owns ivy.xml file. 每个项目都有自己的ivy.xml文件。
ProjectA has a build.xml file like this: ProjectA具有一个build.xml文件,如下所示:
(...)
<ivy:resolve file="../ProjectC/ivy.xml" />
<ivy:cachepath pathid="ivy.deps.default" conf="default" />
<ivy:cachefileset setid="ivy.deps.default.fileset" conf="default"/>
<ivy:resolve file="../ProjectB/ivy.xml" />
<ivy:cachepath pathid="ivy.deps.default" conf="default" />
<ivy:cachefileset setid="ivy.deps.default.fileset" conf="default"/>
<ivy:resolve file="ivy.xml" />
<ivy:cachepath pathid="ivy.deps.default" conf="default" />
<ivy:cachefileset setid="ivy.deps.default.fileset" conf="default"/>
<path id="classpath">
<fileset dir="${webroot}/WEB-INF/lib" erroronmissingdir="no">
<include name="*.jar"/>
</fileset>
<fileset dir="${libraries}" erroronmissingdir="no">
<include name="*.jar"/>
</fileset>
<path refid="ivy.deps.default"/>
</path>
(...)
<javac destdir="c:/abc" includeantruntime="yes" classpathref="ivy.deps.default">
<src path="../ProjectC/src"/>
<classpath refid="classpath"/>
</javac>
(... Compile ProjectB ...)
(... Compile ProjectA ...)
So, running this build.xml results in error, saying that ProjectC could not compile because it was missing a *.jar file that should have been resolved by ivy:resolve command. 因此,运行此build.xml会导致错误,表示ProjectC无法编译,因为它缺少本应由ivy:resolve命令解决的* .jar文件。
My question is: 我的问题是:
Looks like you have an ivy file for each project, but you do not have a build file for each project. 看起来每个项目都有一个常春藤文件,但是每个项目都没有构建文件。 As Mark said in the above comment, each project should build individually. 正如Mark在上述评论中所说,每个项目应单独构建。
For example: 例如:
<resolvers>
list so that IVY looks for dependencies there 将“ SharedLibrary”添加到您的常春藤<resolvers>
列表中,以便IVY在此处查找依赖项 That should get you off to the races! 那应该让您参加比赛!
Pro Tip: instead of a "SharedLibrary" directory, consider using something like Artifactory to manage the artifacts and pull from there instead. 专业提示:而不是“SharedLibrary”目录下,可以考虑使用喜欢的事Artifactory的管理文物,并从那里,而不是拉。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.