3

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 ?

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
elaich
  • 939
  • 1
  • 19
  • 35
  • does the repository have com.caucho - hessian - 3.2.1? – Sean F Feb 26 '13 at 00:39
  • I'm new to ivy, i didn't configure any repository, i was hoping that dependencies will be resolved automatically from mvnrepository, in my EDIT, you'll find the problems summary. – elaich Feb 26 '13 at 06:50

1 Answers1

5

The problem is that version 3.2.1 is not present in 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:

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185