Problems with Ivy and Spring Framework 3.0.0.M3

View: New views
4 Messages — Rating Filter:   Alert me  

Problems with Ivy and Spring Framework 3.0.0.M3

by cressie176 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: Problems with Ivy and Spring Framework 3.0.0.M3

by hdockter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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



Re: Problems with Ivy and Spring Framework 3.0.0.M3

by cressie176 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the explanation. Your suggestion worked as far as "gradle compile" is concerned, but "gradle eclipse" still reports unresloved dependencies...
:::: WARNINGS
		::::::::::::::::::::::::::::::::::::::::::::::

		::          UNRESOLVED DEPENDENCIES         ::

		::::::::::::::::::::::::::::::::::::::::::::::

		:: org.springframework#org.springframework.context;3.0.0.M3: configuration not found in org.springframework#org.springframework.context;3.0.0.M3: 'default'. It was required from unspecified#Residue;unspecified copyOftestRuntime

		:: 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 copyOftestRuntime
even when the dependencies are specified as follows:
		
	compile group: "org.springframework", name: "org.springframework.web", version: "3.0.0.M3", configuration: "runtime" 	
	compile group: "org.springframework", name: "org.springframework.web.servlet", version: "3.0.0.M3", configuration: "runtime" 	
	compile group: "org.springframework", name: "org.springframework.core", version: "3.0.0.M3", configuration: "runtime"

Re: Problems with Ivy and Spring Framework 3.0.0.M3

by hdockter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jun 9, 2009, at 3:27 PM, cressie176 wrote:

> Thanks for the explanation. Your suggestion worked as far as "gradle  
> compile" is concerned, but "gradle eclipse" still reports unresloved  
> dependencies...
> :::: WARNINGS
> ::::::::::::::::::::::::::::::::::::::::::::::
>
> ::          UNRESOLVED DEPENDENCIES         ::
>
> ::::::::::::::::::::::::::::::::::::::::::::::
>
> :: org.springframework#org.springframework.context;3.0.0.M3:  
> configuration not found in  
> org.springframework#org.springframework.context;3.0.0.M3: 'default'.  
> It was required from unspecified#Residue;unspecified copyOftestRuntime
>
> :: 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 copyOftestRuntime
> even when the dependencies are specified as follows:
>
> compile group: "org.springframework", name:  
> "org.springframework.web", version: "3.0.0.M3", configuration:  
> "runtime"
> compile group: "org.springframework", name:  
> "org.springframework.web.servlet", version: "3.0.0.M3",  
> configuration: "runtime"
> compile group: "org.springframework", name:  
> "org.springframework.core", version: "3.0.0.M3", configuration:  
> "runtime"

This is a bug. It is due to the fact that the copy method of a  
dependency does not copy a configuration. I have filed an issue: http://jira.codehaus.org/browse/GRADLE-518

I have already fixed my working copy. The build is just running. So  
this should be fixed in trunk soon.

Thanks

- Hans

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


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

    http://xircles.codehaus.org/manage_email