我有我的version.xml在一個項目中,我定義了所有的IVY配置和依賴關係。我使用ANT腳本下載和檢索文物,到目前爲止一切正常。IVY如何查找特定的依賴項配置正在使用中?
我在尋找的是,無論如何,我可以找到如果某些配置存在於version.xml中,並且某些依賴項被配置爲從ANT腳本中使用它,如檢查,因爲我想做一些額外的東西,如果它配置其他明智的只是略過。例如我的version.xml如下所示:
<?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提供的任何目標,如「常春藤:......」,這可以返回「真」或「假」一些如何告訴我,有正試圖使用配置叫做依賴'componentDep'?這樣我可以做我額外的東西..其他方式跳過。我不想在ANT中自己解析文件,因爲這不是一個好主意。
注:我使用ANT 1.8.2和2.2.0 IVY
希望我做的意義。如果您需要更多信息,請告訴我。
感謝,
-
Sjunejo
我一直在使用做到了<常青藤:cachepath PATHID =「ivy.cache.path」 CONF =「componentDep」 /> Ant任務......如果有則定義沒有依賴的路徑是空的,現在可以用來決定下一步做什麼 – SJunejo
啊,現在我明白你在問什麼了。常春藤文件通常會指定項目的依賴關係。聲明一個配置然後不使用它會是很奇怪的......但是在你的情況下,因爲我懷疑你是在運行時生成常青藤文件,這成爲一種可能性。 –