加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

依赖关系 – 如何排除春季与常春藤的依赖关系?

发布时间:2020-12-13 20:24:59 所属栏目:百科 来源:网络整理
导读:我有一个项目构建与ant使用常春藤依赖管理.我没有ivysetting文件,但是具有以下依赖关系的ivy.xml(我想使用 spring with slf4j而不是commons logging): configurations conf name="compile" / conf name="runtime" extends="compile"//configurationsdepende
我有一个项目构建与ant使用常春藤依赖管理.我没有ivysetting文件,但是具有以下依赖关系的ivy.xml(我想使用 spring with slf4j而不是commons logging):
<configurations>
  <conf name="compile" />
  <conf name="runtime" extends="compile"/>
</configurations>
<dependencies>
  <dependency org="org.springframework" name="spring-webmvc" rev="3.0.5.RELEASE" conf="compile->default">
    <exclude org="commons-logging" name="commons-logging"/>
  </dependency>
  <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" conf="compile->default" />
  <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" conf="runtime->default" />
</dependencies>

但是在解析编译配置时,commons-logging已解决.我也试图在显式的spring-core依赖中使用exclude,但是commons-logging总是放在编译类路径中.

我的错是什么是不是Not Using Commons Logging描述了maven?它是常春藤虫吗?需要我一个特殊的设置?常春藤有东西缓存吗?任何想法?

我使用ant 1.8.2和ivy 2.2.0,在Eclipse中使用IvyDE也有同样的问题.

您使用< exclude />似乎因为未知的原因而被打破.我在我的电脑上尝试过类似的东西,以下工作:
尝试 the top-level exclude(它直接位于< dependencies /&gt ;::
<dependencies>
      <dependency org="org.springframework" name="spring-webmvc" rev="3.0.5.RELEASE" conf="compile->default">
      </dependency>
      <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" conf="compile->default" />
      <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" conf="runtime->default" />
      <exclude org="commons-logging"/>
</dependencies>

我不知道为什么另一个不工作. JIRA中有一些关于排除和循环依赖的错误,但这似乎并不适合这种情况.也许这是一个真正的错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读