jtanistra / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

Latest 0.6 snapshots for spock-spring add spring-core force spring 3.1.0 into the runtime #238

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi all,

We have a project currently running on Spring 3.0.5.RELEASE and we're using 
Spock Spring to test.  We were running happily for quite some time, but the 
latest snapshot pull added some 3.1.0 stuff to our test classpath, resulting in 
chaos.

1. Create a spring project using 3.0.x.RELEASE
2. Add spock-spring to the test scope
3. Spring 3.1.0 release gets added to the test classpath

What version of Spock and Groovy are you using?
Groovy 1.8
Spock 0.6-groovy-1.8-SNAPSHOT

Somewhere in the last couple of days, the spock-spring module started added 
spring-beans to its compile scope:

http://m2repo.spockframework.org/snapshots/org/spockframework/spock-spring/0.6-g
roovy-1.8-SNAPSHOT/spock-spring-0.6-groovy-1.8-20120227.045740-407.pom

This is causing the following error for projects running a 3.0.x.RELEASE 
version:

10:36:22  java.lang.NoClassDefFoundError: 
org/springframework/core/env/EnvironmentCapable
10:36:22    at java.lang.ClassLoader.defineClass1(Native Method)
10:36:22    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
10:36:22    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
10:36:22    at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
10:36:22    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
10:36:22    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
10:36:22    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
10:36:22    at java.security.AccessController.doPrivileged(Native Method)
10:36:22    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
10:36:22    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
10:36:22    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
10:36:22    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
10:36:22    at java.lang.ClassLoader.defineClass1(Native Method)
10:36:22    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
10:36:22    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
10:36:22    at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
10:36:22    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
10:36:22    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
10:36:22    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
10:36:22    at java.security.AccessController.doPrivileged(Native Method)
10:36:22    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
10:36:22    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
10:36:22    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
10:36:22    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
10:36:22    at 
org.springframework.test.context.support.GenericXmlContextLoader.createBeanDefin
itionReader(GenericXmlContextLoader.java:39)

It appears that spring-beans, etc dependencies used to be in the "provided" 
scope, so that downstream projects could use whichever spring version they 
choose:

http://m2repo.spockframework.org/snapshots/org/spockframework/spock-spring/0.6-g
roovy-1.8-SNAPSHOT/spock-spring-0.6-groovy-1.8-SNAPSHOT.pom

Can we go back to that model? 

Original issue reported on code.google.com by cedric.h...@gmail.com on 27 Feb 2012 at 10:20

GoogleCodeExporter commented 8 years ago
Thanks for raising your voice - just in time to fix for the 0.6 release. I 
think the provided scope got lost quite a while ago when we switched the 
release build to Gradle. But probaby you weren't affected until we bumped the 
Spring version to 3.1. (We did that mainly to have a build that tests against 
3.1.) The good news is that spock-spring still supports everything between 
Spring 2.5 and 3.1.

Original comment by pnied...@gmail.com on 27 Feb 2012 at 10:41

GoogleCodeExporter commented 8 years ago
Should be fixed. Could you give this a try immediately?

Original comment by pnied...@gmail.com on 28 Feb 2012 at 2:11

GoogleCodeExporter commented 8 years ago
I tested removing the exclusions of the poms and seems to work fine, can you 
point me to the commit with the fix? Thanks

Original comment by fen...@gmail.com on 1 Mar 2012 at 6:36

GoogleCodeExporter commented 8 years ago
https://github.com/spockframework/spock/commit/d08910e8b38fcceee7713caaf3de49ae8
a3cb28a

Original comment by pnied...@gmail.com on 1 Mar 2012 at 6:43