我如何知道哪些配置可用於特定的依賴關係?我該如何知道常春藤依賴項中有哪些配置可用?
我明白這些都是常見的配置:默認情況下,主,編譯,提供測試,系統,資源,javadoc的,可選的,運行時
但一些依賴性不具備所有這些定義,其他定義其他自定義配置。我沒有看到關於springource或maven回購的可用配置的任何提及。
下面是我尷尬的黑客一起ivy.xml。請注意,我將org.springframework.spring-library conf定義爲「runtime」。這會失敗,因爲org.springframework.spring-library沒有「運行時」配置文件。
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="com.myapp" module="MyAppName" revision="1.0"/>
<configurations>
<conf name="compile" visibility="public" description="Dependencies needed for compile"/>
<conf name="runtime" visibility="public" extends="compile" description="Dependencies needed for runtime"/>
<conf name="test" visibility="private" description="Test dependencies"/>
</configurations>
<dependencies>
<dependency org="org.springframework" name="org.springframework.spring-library" rev="3.1.0.RELEASE" conf="runtime"/>
<dependency org="org.springframework.security" name="spring-security-web" rev="3.1.0.RELEASE" transitive="false" conf="*"/>
<dependency org="org.springframework.security" name="spring-security-config" rev="3.1.0.RELEASE" transitive="false" conf="*"/>
<dependency org="org.springframework.security" name="spring-security-core" rev="3.1.0.RELEASE" transitive="false" conf="*"/>
<dependency org="org.codehaus.jackson" name="com.springsource.org.codehaus.jackson" rev="1.4.3" conf="runtime->*"/>
<dependency org="org.codehaus.jackson" name="com.springsource.org.codehaus.jackson.mapper" rev="1.4.3" conf="runtime->*"/>
<dependency org="org.apache.httpcomponents" name="com.springsource.org.apache.httpcomponents.httpclient" rev="4.1.1" conf="runtime->*" />
<dependency org="org.aspectj" name="org.aspectj-library" rev="1.6.5.RELEASE" conf="runtime,compile->runtime(default)"/>
<dependency org="net.sourceforge.cglib" name="com.springsource.net.sf.cglib" rev="2.2.0" conf="compile->*"/>
<dependency org="log4j" name="log4j" rev="1.2.14" conf="runtime->*"/>
<dependency org="joda-time" name="joda-time" rev="2.0" conf="runtime,compile->runtime(default)"/>
<exclude type="license" ext="txt"/>
<exclude type="notice" ext="txt"/>
<exclude org="javax.servlet" conf="runtime"/>
<exclude org="javax.el" conf="runtime"/>
<exclude org="javax.faces" conf="runtime"/>
<exclude org="javax.portlet" conf="runtime"/>
<exclude org="javax.xml.rpc" conf="runtime"/>
<exclude org="javax.xml.soap" conf="runtime"/>
<exclude org="javax.xml.ws" conf="runtime"/>
<exclude org="commons-logging" conf="runtime"/>
</dependencies>
</ivy-module>
那麼人們是這樣做的嗎?這似乎很荒謬(在常春藤的部分)。如果知道哪些配置可用於依賴關係如此重要,那麼爲什麼沒有一種簡單高效的方式來獲取這些數據? – vopilif 2012-02-01 21:10:59
可瀏覽的常春藤庫更容易。例如[Ivy Roundup回購](http://ivyroundup.googlecode.com/svn/trunk/repo/modules.xml)使得它很容易得到這些信息。例如http://ivyroundup.googlecode.com/svn/trunk/repo/modules/org.apache.activemq/activeio/3.1.0/ivy.xml – 2012-02-01 22:33:03
看起來像ivyroundup沒有彈簧3.1.0。雖然我想配置可能是相同的,這正是我與常春藤的挫折感。 – vopilif 2012-02-01 23:24:22