【问题标题】:ivy - spring-web has unresolved dependenciesivy - spring-web 有未解决的依赖关系
【发布时间】:2013-02-11 04:56:42
【问题描述】:

当我将此行添加到我的 ivy.xml 文件时:

 <ivy-module version="2.0">
     <info organisation="Marouane" module="example"/>
     <dependencies>
         <dependency org="com.sun.faces" name="jsf-impl" rev="2.1.19" />
         <dependency org="com.sun.faces" name="jsf-api" rev="2.1.19" />
         <dependency org="org.springframework" name="spring-context" rev="3.2.1.RELEASE" />
         <!-- this line -->
         <dependency org="org.springframework" name="spring-web" rev="3.2.1.RELEASE" />
     </dependencies>
 </ivy-module>

我收到有关未解决依赖项的警告,但没有下载任何内容。

::::::::::::::::::::::::::::::::::::::::::::::
::          UNRESOLVED DEPENDENCIES         ::
::::::::::::::::::::::::::::::::::::::::::::::
:: com.caucho#hessian;3.2.1: not found
::::::::::::::::::::::::::::::::::::::::::::::

编辑: 以下是问题总结:

    module not found: com.caucho#hessian;3.2.1
==== local: tried
  $HOME/.ivy2/local/com.caucho/hessian/3.2.1/ivys/ivy.xml
  -- artifact com.caucho#hessian;3.2.1!hessian.jar:
  $HOME/.ivy2/local/com.caucho/hessian/3.2.1/jars/hessian.jar
==== shared: tried
  $HOME/.ivy2/shared/com.caucho/hessian/3.2.1/ivys/ivy.xml
  -- artifact com.caucho#hessian;3.2.1!hessian.jar:
  $HOME/.ivy2/shared/com.caucho/hessian/3.2.1/jars/hessian.jar
==== public: tried
  http://repo1.maven.org/maven2/com/caucho/hessian/3.2.1/hessian-3.2.1.pom
  -- artifact com.caucho#hessian;3.2.1!hessian.jar:
  http://repo1.maven.org/maven2/com/caucho/hessian/3.2.1/hessian-3.2.1.jar

我访问了maven存储库网站,the page of Spring web 3.2.1,hessian 3.2.1被列为依赖项,但是the page of hessian中没有3.2.1版本的hessian包,是这个问题吗?我该如何继续?

【问题讨论】:

  • 仓库是否有 com.caucho - hessian - 3.2.1?
  • 我是 ivy 新手,我没有配置任何存储库,我希望从 mvnrepository 自动解决依赖关系,在我的编辑中,您会找到问题摘要。

标签: spring-mvc ivy


【解决方案1】:

问题是 Maven Central 中不存在 3.2.1 版本:

根本原因是Spring-web POM,它有如下依赖:

<dependency>
  <groupId>com.caucho</groupId>
  <artifactId>hessian</artifactId>
  <version>3.2.1</version>
  <scope>compile</scope>
  <optional>true</optional>
</dependency>

这是一个可选依赖项,因此有几个变通方法。

声明更新的版本

如果您的功能需要此 jar,请使用此选项(作者将其设为可选是有原因的)。

<dependency org="org.springframework" name="spring-web" rev="3.2.1.RELEASE" />
<dependency org="com.caucho" name="hessian" rev="4.0.7" />

如果您生成一个 ivy report,您会看到 ivy “驱逐”旧(缺失)版本,转而支持 4.0.7

使用配置映射

此“默认”配置映射将仅包括编译范围依赖项(这是 Maven 默认的)并排除任何标记为可选的内容:

<dependency org="org.springframework" name="spring-web" rev="3.2.1.RELEASE" conf="default"/>

有关 ivy 中配置映射的更多信息,请阅读:

【讨论】:

    猜你喜欢
    • 2011-12-11
    • 2012-12-24
    • 2011-12-10
    • 2016-01-06
    • 2016-10-11
    • 2015-06-04
    • 2020-06-21
    • 2018-12-05
    • 2014-09-19
    相关资源
    最近更新 更多