Ant IVY如何找到正在使用的特定依赖项配置?
在一个项目中,我定义了所有常春藤配置和依赖项,其中有我的version.xml。我使用ANT脚本下载和检索人工制品,到目前为止一切正常 我要寻找的是,无论如何,我都可以找到version.xml中是否存在某些配置,以及是否配置了某些依赖项以从ANT脚本中使用它,比如check,因为如果它是以其他方式配置的,我想做一些额外的工作,只需跳过即可。例如,my version.xml如下所示Ant IVY如何找到正在使用的特定依赖项配置?,ant,ivy,Ant,Ivy,在一个项目中,我定义了所有常春藤配置和依赖项,其中有我的version.xml。我使用ANT脚本下载和检索人工制品,到目前为止一切正常 我要寻找的是,无论如何,我都可以找到version.xml中是否存在某些配置,以及是否配置了某些依赖项以从ANT脚本中使用它,比如check,因为如果它是以其他方式配置的,我想做一些额外的工作,只需跳过即可。例如,my version.xml如下所示 <?xml-stylesheet type="text/xsl" href="http://reposit
<?xml-stylesheet type="text/xsl" href="http://repository.temenosgroup.com/xsl/version-doc.xsl"?>
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
<info organisation="TEMENOS" branch="MAIN" module="StateEngine" />
<!-- "war->compile(*)" this means the 'war' configuration depends on the
'compile' configuration of the dependency and if the dependency is not
found in 'compile' then use the 'default' (same as '*') config (usually that is all dependencies) -->
<configurations defaultconfmapping="test->test(*);compile->compile(*);componentDep->componentDep(*)">
<conf name="test" description="Test Time dependencies"/>
<conf name="compile" description="Build Time dependencies"/>
<conf name="componentDep" description="To resolve component level dependencies" />
</configurations>
<publications>
<artifact name="#SERVICE_NAME#" type="" ext="zip" />
<artifact name="#SERVICE_NAME#" type="" ext="zip" e:platform="#PLATFORM_WIN#" />
<artifact name="#SERVICE_NAME#" type="" ext="zip" e:platform="#PLATFORM_UNIX#" />
</publications>
<dependencies>
....
<!-- Define Component Level Dependencies Below -->
<dependency org="TEMENOS" branch="MAIN" name="StateMachine" transitive="false" rev="latest-dev" conf="componentDep" >
<artifact name="StateMachineService" ext="zip" e:platform="#PLATFORM_WIN#" type="" conf="componentDep" />
<artifact name="StateMachineService" ext="zip" e:platform="#PLATFORM_UNIX#" type="" conf="componentDep" />
<artifact name="StateMachineService" ext="zip" type="" conf="componentDep" />
</dependency>
</dependencies>
</ivy-module>
....
那么,在ANT中是否有像“ivy:…”这样可以返回“true”或“false”的目标?如何告诉我有一个依赖项正在尝试使用名为“componentDep”的配置?这样我就可以做额外的事情了,否则就跳过。我不想自己在ANT中解析文件,因为这不是一个很好的主意
注意:我使用的是ANT 1.8.2和IVY 2.2.0
希望我说的有道理。如果你需要更多信息,请告诉我
谢谢
--
Sjunejo通常使用名为Ivy.xml的文件进行解析 我怀疑您的version.xml文件是设计用来替换的?也许您的构建正在运行时生成ivy文件 怀疑的理由 ivy发布的文件名似乎无效。。。。我怀疑你正在创建名为#服务名称#.zip的3个文件
<publications>
<artifact name="#SERVICE_NAME#" type="" ext="zip" />
<artifact name="#SERVICE_NAME#" type="" ext="zip" e:platform="#PLATFORM_WIN#" />
<artifact name="#SERVICE_NAME#" type="" ext="zip" e:platform="#PLATFORM_UNIX#" />
</publications>
? 这将创建与每个项目配置关联的文件的HTML报告。用法如下:
<target name="init">
<ivy:resolve/>
<ivy:report todir='${ivy.reports.dir}' graph='false' xml='false'/>
..
</target>
..
我已经使用ant task完成了这项工作……如果没有定义依赖项,那么路径将为空,现在可以使用该路径来决定下一步要做什么。现在我明白您的要求了。常春藤文件通常会指定项目的依赖项。声明一个配置然后不使用它是非常奇怪的。。。。。然而,在您的情况下,因为我怀疑您正在运行时生成常春藤文件,所以这成为一种可能性。