0

My build runs fine until I add the following line to my ivy.xml file:

<dependency org="org.springframework.data" name="spring-data-jpa" rev="1.1.0.RELEASE"/>

Then I get the following error:

::::::::::::::::::::::::::::::::::::::::::::::
::          UNRESOLVED DEPENDENCIES         ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.eclipse.persistence#org.eclipse.persistence.jpa;2.3.2: not found
:::::::::::::::::::::::::::::::::::::::::::::: 

I cannot seem to find this dependency in the Maven repo. When not using Ivy, i'm able to successfully compile my project with this jar:

com.springsource.javax.persistence-2.0.0.jar

However, I can't find a reference to that one in the Maven repo either.

What am I missing or doing wrong? New to using Ivy, so any and all help is appreciated.

SBerg413
  • 14,515
  • 6
  • 62
  • 88

1 Answers1

2

By default ivy will pull down all the dependencies. Most likely this is an optional Maven dependency that does not exist in Maven Central.

What you need to do is setup an ivy configuration mapping for each of your dependencies as follows:

<configurations>
    <conf name="compile" description="Compile classpath"/>
    <conf name="runtime" description="Runtime classpath" extends="compile"/>
    <conf name="test" description="Test classpath" extends="runtime"/>
</configurations>

<dependencies>
    <!-- compile dependencies -->
    <dependency org="org.springframework.data" name="spring-data-jpa" rev="1.1.0.RELEASE" conf="compile->default"/>
</dependencies>

The mapping "compile->default" means pull down the default dependencies (which would exclude optionals) from the remote module and place them into the local compile configuration.

For more information on how ivy translates remote Maven modules see:

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