« Return to Thread: Problems with Ivy and Spring Framework 3.0.0.M3

Re: Problems with Ivy and Spring Framework 3.0.0.M3

by hdockter :: Rate this Message:

Reply to Author | View in Thread


On Jun 9, 2009, at 12:44 PM, cressie176 wrote:

> I'm trying to use the springframework 3.0.0.M3 release which is  
> hosted in an ivy repository
> repositorys {
>     ...
>     add(new org.apache.ivy.plugins.resolver.URLResolver()) {
>     name = 'spring-milestones'
>     addIvyPattern "http://repository.springsource.com/ivy/bundles/milestone/ 
> [organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
>     addArtifactPattern "http://repository.springsource.com/ivy/bundles/milestone/ 
> [organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
>     }
> }
>
> dependencies {
> ...
> compile "org.springframework:org.springframework.core:3.0.0.M3"
> compile "org.springframework:org.springframework.context:3.0.0.M3"
> compile "org.springframework:org.springframework.beans:3.0.0.M3"
> compile "org.springframework:org.springframework.web:3.0.0.M3"
> compile "org.springframework:org.springframework.web.servlet:
> 3.0.0.M3"
> ...
> }
> The files seem to be downloading OK but I end up with the following  
> error.
> downloading (5 KB) http://repository.springsource.com/ivy/bundles/milestone/org.springframework/org.springframework.web/3.0.0.M3/ivy-3.0.0.M3.xml
> ...
> downloading (6 KB) http://repository.springsource.com/ivy/bundles/milestone/org.springframework/org.springframework.web.servlet/3.0.0.M3/ivy-3.0.0.M3.xml
> .....
> :: problems summary ::
> :::: WARNINGS
> ::::::::::::::::::::::::::::::::::::::::::::::
>
> ::          UNRESOLVED DEPENDENCIES         ::
>
> ::::::::::::::::::::::::::::::::::::::::::::::
>
> :: org.springframework#org.springframework.web;3.0.0.M3:  
> configuration not found in  
> org.springframework#org.springframework.web;3.0.0.M3: 'default'. It  
> was required from unspecified#Residue;unspecified compile
>
> :: org.springframework#org.springframework.web.servlet;3.0.0.M3:  
> configuration not found in  
> org.springframework#org.springframework.web.servlet;3.0.0.M3:  
> 'default'. It was required from unspecified#Residue;unspecified  
> compile
>
> ::::::::::::::::::::::::::::::::::::::::::::::
> I suspect this is an Ivy Config / Spring issue rather than anything  
> to do with gradle, but not being familiar with Ivy I haven't got a  
> clue what it means, or how to fix it. Any help appreciated. S

If you look at the ivy.xml of http://repository.springsource.com/ivy/bundles/milestone/org.springframework/org.springframework.web/3.0.0.M3/ivy-3.0.0.M3.xml 
  you can see that there are a number of custom configurations  
defined. Each configuration specifies a set of jars published by this  
project as well as the dependencies of those jars. If you look at the  
publications element of the ivy.xml you find two entries. They don't  
specify any particular configuration they belong to. This means this  
project published two jars and they belong to every configuration. If  
you look at the dependencies section you will see that different  
dependencies belong to different configurations.

The 'default' configuration has a special meaning in ivy. If you  
declare a dependency and don't specify a configuration for this  
dependency, ivy uses the default configuration (in case you access a  
pom.xml via Ivy, default corresponds to the runtime Maven scope). But  
the particular Spring project above does not define a default  
configuration. Therefore you need to choose which configuration you  
want to use. You can do that by:

compile group: "org.springframework", name: "org.springframework.web",  
version: "3.0.0.M3", configuration: "runtime"

You have to use the Gradle map notation if you want to specify  
configurations.

In Ivy you can change the name of the default configuration. You can  
even define a filter that a different default configuration shall be  
used only for dependencies belonging to a certain group (aka  
organization). In you case for example it would make sense to say, for  
all spring dependencies use 'runtime' as the default configuration,  
for the others use 'default'. But this is not offered by Gradle yet.

- Hans

--
Hans Dockter
Gradle Project Manager
http://www.gradle.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Problems with Ivy and Spring Framework 3.0.0.M3