Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ivy - spring-web has unresolved dependencies

Tags:

spring-mvc

ivy

When i add this line to my ivy.xml file:

 <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>

i have a warning about an unresolved dependency and nothing is downloaded.

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

EDIT: Here is the problems summary:

    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

I have visited the maven repository website, the page of Spring web 3.2.1, hessian 3.2.1 is listed as a dependency, but in the the page of hessian there is no hessian pack of version 3.2.1, is this the problem ? how can i proceed ?

like image 869
elaich Avatar asked Dec 04 '25 18:12

elaich


1 Answers

The problem is that version 3.2.1 is not present in Maven Central:

  • Maven Central

The root cause is Spring-web POM, which has the following dependency:

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

This is an optional dependency, so there are a couple of work-arounds.

Declare more recent version

Use this option if your functionality needs this jar (There's a reason the author made it optional).

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

If you generate an ivy report, you'll see that ivy "evicts" the older (missing) version in favour of 4.0.7

Use a configuration mapping

This "default" configuration mapping will include only the compile scope dependencies (which is the Maven default) and exclude anything marked as optional:

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

For more information on configuration mappings in ivy read:

  • How are maven scopes mapped to ivy configurations by ivy
like image 162
Mark O'Connor Avatar answered Dec 07 '25 01:12

Mark O'Connor