Edw*_*ale 21 apache dependencies ivy
这是我的ivy.xml现在的样子:
<dependency org="org.springframework" name="org.springframework.core" rev="3.0.2.RELEASE" />
<dependency org="org.springframework" name="org.springframework.context" rev="3.0.2.RELEASE" />
<dependency org="org.springframework" name="org.springframework.jdbc" rev="3.0.2.RELEASE" />
<dependency org="org.springframework" name="org.springframework.beans" rev="3.0.2.RELEASE" />
<dependency org="org.springframework" name="org.springframework.jms" rev="3.0.2.RELEASE" />
Run Code Online (Sandbox Code Playgroud)
这是我希望它看起来像:
<dependency org="org.springframework" name="org.springframework.core" rev="${spring.version}" />
<dependency org="org.springframework" name="org.springframework.context" rev="${spring.version}" />
<dependency org="org.springframework" name="org.springframework.jdbc" rev="${spring.version}" />
<dependency org="org.springframework" name="org.springframework.beans" rev="${spring.version}" />
<dependency org="org.springframework" name="org.springframework.jms" rev="${spring.version}" />
Run Code Online (Sandbox Code Playgroud)
这可能吗?语法是什么?
Edw*_*ale 29
我最终使用XML实体进行替换.这会将所有内容保存在同一个文件中,这对我的用例非常重要.
<?xml version="1.0"?>
<!DOCTYPE ivy-module [
<!ENTITY spring.version "3.0.2.RELEASE">
]>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd">
<info organisation="org" module="mod"/>
<dependencies>
<dependency org="org.springframework" name="org.springframework.core" rev="&spring.version;" />
<dependency org="org.springframework" name="org.springframework.context" rev="&spring.version;" />
<dependency org="org.springframework" name="org.springframework.jdbc" rev="&spring.version;" />
<dependency org="org.springframework" name="org.springframework.beans" rev="&spring.version;" />
<dependency org="org.springframework" name="org.springframework.jms" rev="&spring.version;" />
</dependencies>
</ivy-module>
Run Code Online (Sandbox Code Playgroud)
Mar*_*nor 14
语法是正确的.您需要做的就是在某处设置ANT属性.
例如
ant -Dspring.version=3.0.2.RELEASE
Run Code Online (Sandbox Code Playgroud)
另一种方法是将属性声明添加到ivysettings.xml文件中
<ivysettings>
<property name="spring.version" value="3.0.2.RELEASE"/>
<settings defaultResolver="maven2"/>
<resolvers>
<ibiblio name="maven2" m2compatible="true"/>
</resolvers>
</ivysettings>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6183 次 |
最近记录: |