gpt4 book ai didi

apache - 我可以使用ivy.xml文件中的属性来避免重复依赖性的版本号吗?

转载 作者:行者123 更新时间:2023-12-03 11:48:44 26 4
gpt4 key购买 nike

这是我的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" />

这是我想要的样子:
<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}" />

这可能吗?语法是什么?

最佳答案

我最终使用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>

关于apache - 我可以使用ivy.xml文件中的属性来避免重复依赖性的版本号吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2996048/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com