|
I ran into some trouble today when I changed my JUnit test to use
@RunWith(CamelSpringJUnit4ClassRunner.class) from camel-spring-test It turned out that a transient dependency had resolved to: org.springframework:spring-beans:jar:3.0.7.RELEASE:compile This one was correct however: org.springframework:spring-test:jar:3.1.1.RELEASE:test Looking at the dependency:tree for camel-spring and camel-test-spring +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:compile | +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile | | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile | | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile | | | \- commons-logging:commons-logging:jar:1.1.1:compile | | +- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile | | \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile | | \- aopalliance:aopalliance:jar:1.0:compile | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test Is this how it is supposed to be? I can get around it by adding the transient spring-dependencies for camel-spring to be declared explicitly. Or am I missing something? |
|
In the camel-parent pom:
<spring-version>3.0.7.RELEASE</spring-version> And in camel-test-spring pom: <spring-version>3.1.1.RELEASE</spring-version> Den 18 april 2012 23:12 skrev Magnus Palmér <[hidden email]>: > I ran into some trouble today when I changed my JUnit test to use > @RunWith(CamelSpringJUnit4ClassRunner.class) from camel-spring-test > > It turned out that a transient dependency had resolved to: > org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > > This one was correct however: > org.springframework:spring-test:jar:3.1.1.RELEASE:test > > Looking at the dependency:tree for camel-spring and camel-test-spring > > +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:compile > | +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile > | | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > | | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > | | | \- commons-logging:commons-logging:jar:1.1.1:compile > | | +- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > | | \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > | | \- aopalliance:aopalliance:jar:1.0:compile > | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > > +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test > > Is this how it is supposed to be? > I can get around it by adding the transient spring-dependencies for > camel-spring to be declared explicitly. > Or am I missing something? > > > > |
|
There are compiling issue of camel-test-spring with spring 3.0.x, but
it should work by just applying the jar into the class path. You can override the spring version in your pom this time. On Thu Apr 19 05:23:07 2012, Magnus Palmér wrote: > In the camel-parent pom: > <spring-version>3.0.7.RELEASE</spring-version> > > And in camel-test-spring pom: > <spring-version>3.1.1.RELEASE</spring-version> > > Den 18 april 2012 23:12 skrev Magnus Palmér<[hidden email]>: > >> I ran into some trouble today when I changed my JUnit test to use >> @RunWith(CamelSpringJUnit4ClassRunner.class) from camel-spring-test >> >> It turned out that a transient dependency had resolved to: >> org.springframework:spring-beans:jar:3.0.7.RELEASE:compile >> >> This one was correct however: >> org.springframework:spring-test:jar:3.1.1.RELEASE:test >> >> Looking at the dependency:tree for camel-spring and camel-test-spring >> >> +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:compile >> | +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile >> | | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile >> | | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile >> | | | \- commons-logging:commons-logging:jar:1.1.1:compile >> | | +- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile >> | | \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile >> | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile >> | | \- aopalliance:aopalliance:jar:1.0:compile >> | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile >> >> +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test >> | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test >> >> Is this how it is supposed to be? >> I can get around it by adding the transient spring-dependencies for >> camel-spring to be declared explicitly. >> Or am I missing something? >> >> >> >> > -- Willem ---------------------------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang |
|
It works when adding spring-context dependency 3.1.1 to my pom.
What you are saying works for camel-test-spring since the spring dependencies are managed explicitly, maybe that is good practice? I am not that experienced with spring yet. Maybe it should say something about it in the wiki for spring test? Den 19 apr 2012 03:31 skrev "Willem Jiang" <[hidden email]>: > There are compiling issue of camel-test-spring with spring 3.0.x, but it > should work by just applying the jar into the class path. > You can override the spring version in your pom this time. > > On Thu Apr 19 05:23:07 2012, Magnus Palmér wrote: > >> In the camel-parent pom: >> <spring-version>3.0.7.RELEASE<**/spring-version> >> >> And in camel-test-spring pom: >> <spring-version>3.1.1.RELEASE<**/spring-version> >> >> Den 18 april 2012 23:12 skrev Magnus Palmér<magnus.palmer.work@** >> gmail.com <[hidden email]>>: >> >> I ran into some trouble today when I changed my JUnit test to use >>> @RunWith(**CamelSpringJUnit4ClassRunner.**class) from camel-spring-test >>> >>> It turned out that a transient dependency had resolved to: >>> org.springframework:spring-**beans:jar:3.0.7.RELEASE:**compile >>> >>> This one was correct however: >>> org.springframework:spring-**test:jar:3.1.1.RELEASE:test >>> >>> Looking at the dependency:tree for camel-spring and camel-test-spring >>> >>> +- org.apache.camel:camel-spring:**jar:2.10-SNAPSHOT:compile >>> | +- org.springframework:spring-**context:jar:3.0.7.RELEASE:**compile >>> | | +- org.springframework:spring-**beans:jar:3.0.7.RELEASE:**compile >>> | | +- org.springframework:spring-**core:jar:3.0.7.RELEASE:compile >>> | | | \- commons-logging:commons-**logging:jar:1.1.1:compile >>> | | +- org.springframework:spring-**expression:jar:3.0.7.RELEASE:** >>> compile >>> | | \- org.springframework:spring-**asm:jar:3.0.7.RELEASE:compile >>> | +- org.springframework:spring-**aop:jar:3.0.7.RELEASE:compile >>> | | \- aopalliance:aopalliance:jar:1.**0:compile >>> | \- org.springframework:spring-tx:**jar:3.0.7.RELEASE:compile >>> >>> +- org.apache.camel:camel-test-**spring:jar:2.10-SNAPSHOT:test >>> | \- org.springframework:spring-**test:jar:3.1.1.RELEASE:test >>> >>> Is this how it is supposed to be? >>> I can get around it by adding the transient spring-dependencies for >>> camel-spring to be declared explicitly. >>> Or am I missing something? >>> >>> >>> >>> >>> >> > > > -- > Willem > ------------------------------**---- > CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com > FuseSource > Web: http://www.fusesource.com > Blog: http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English) > http://jnn.javaeye.com (Chinese) > Twitter: willemjiang > Weibo: willemjiang > > |
|
On Thu Apr 19 16:40:05 2012, Magnus Palmér wrote:
> It works when adding spring-context dependency 3.1.1 to my pom. I just checked the code of camel-test-spring, if you are using the CamelSpringJUnit4ClassRunner, you need to use the Spring 3.1.1. As the CamelSpringTestContextLoader doesn't support spring 3.0.x. > > What you are saying works for camel-test-spring since the spring > dependencies are managed explicitly, maybe that is good practice? > I am not that experienced with spring yet. > > Maybe it should say something about it in the wiki for spring test? Yes, we should add some document for it. > Den 19 apr 2012 03:31 skrev "Willem Jiang"<[hidden email]>: > >> There are compiling issue of camel-test-spring with spring 3.0.x, but it >> should work by just applying the jar into the class path. >> You can override the spring version in your pom this time. >> >> On Thu Apr 19 05:23:07 2012, Magnus Palmér wrote: >> >>> In the camel-parent pom: >>> <spring-version>3.0.7.RELEASE<**/spring-version> >>> >>> And in camel-test-spring pom: >>> <spring-version>3.1.1.RELEASE<**/spring-version> >>> >>> Den 18 april 2012 23:12 skrev Magnus Palmér<magnus.palmer.work@** >>> gmail.com<[hidden email]>>: >>> >>> I ran into some trouble today when I changed my JUnit test to use >>>> @RunWith(**CamelSpringJUnit4ClassRunner.**class) from camel-spring-test >>>> >>>> It turned out that a transient dependency had resolved to: >>>> org.springframework:spring-**beans:jar:3.0.7.RELEASE:**compile >>>> >>>> This one was correct however: >>>> org.springframework:spring-**test:jar:3.1.1.RELEASE:test >>>> >>>> Looking at the dependency:tree for camel-spring and camel-test-spring >>>> >>>> +- org.apache.camel:camel-spring:**jar:2.10-SNAPSHOT:compile >>>> | +- org.springframework:spring-**context:jar:3.0.7.RELEASE:**compile >>>> | | +- org.springframework:spring-**beans:jar:3.0.7.RELEASE:**compile >>>> | | +- org.springframework:spring-**core:jar:3.0.7.RELEASE:compile >>>> | | | \- commons-logging:commons-**logging:jar:1.1.1:compile >>>> | | +- org.springframework:spring-**expression:jar:3.0.7.RELEASE:** >>>> compile >>>> | | \- org.springframework:spring-**asm:jar:3.0.7.RELEASE:compile >>>> | +- org.springframework:spring-**aop:jar:3.0.7.RELEASE:compile >>>> | | \- aopalliance:aopalliance:jar:1.**0:compile >>>> | \- org.springframework:spring-tx:**jar:3.0.7.RELEASE:compile >>>> >>>> +- org.apache.camel:camel-test-**spring:jar:2.10-SNAPSHOT:test >>>> | \- org.springframework:spring-**test:jar:3.1.1.RELEASE:test >>>> >>>> Is this how it is supposed to be? >>>> I can get around it by adding the transient spring-dependencies for >>>> camel-spring to be declared explicitly. >>>> Or am I missing something? >>>> >>>> >>>> >>>> >>>> >>> >> >> >> -- >> Willem >> ------------------------------**---- >> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com >> FuseSource >> Web: http://www.fusesource.com >> Blog: http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English) >> http://jnn.javaeye.com (Chinese) >> Twitter: willemjiang >> Weibo: willemjiang >> >> > -- Willem ---------------------------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang |
|
On Thu, Apr 19, 2012 at 3:20 PM, Willem Jiang <[hidden email]> wrote:
> On Thu Apr 19 16:40:05 2012, Magnus Palmér wrote: >> >> It works when adding spring-context dependency 3.1.1 to my pom. > > > I just checked the code of camel-test-spring, if you are using the > CamelSpringJUnit4ClassRunner, you need to use the Spring 3.1.1. > As the CamelSpringTestContextLoader doesn't support spring 3.0.x. > > >> >> What you are saying works for camel-test-spring since the spring >> dependencies are managed explicitly, maybe that is good practice? >> I am not that experienced with spring yet. >> >> Maybe it should say something about it in the wiki for spring test? > > > Yes, we should add some document for it. > Can we not mark the spring 3.1.1 as <scope>provided</scope> or something with Maven. Frankly I think Spring 3.1.1 should only be on the classpath if the end user explicit have added it himself. Then maybe using camel-test-spring will only keep Spring 3.0.7 on the classpath out of the box. > > >> Den 19 apr 2012 03:31 skrev "Willem Jiang"<[hidden email]>: >> >>> There are compiling issue of camel-test-spring with spring 3.0.x, but it >>> should work by just applying the jar into the class path. >>> You can override the spring version in your pom this time. >>> >>> On Thu Apr 19 05:23:07 2012, Magnus Palmér wrote: >>> >>>> In the camel-parent pom: >>>> <spring-version>3.0.7.RELEASE<**/spring-version> >>>> >>>> And in camel-test-spring pom: >>>> <spring-version>3.1.1.RELEASE<**/spring-version> >>>> >>>> Den 18 april 2012 23:12 skrev Magnus Palmér<magnus.palmer.work@** >>>> gmail.com<[hidden email]>>: >>>> >>>> I ran into some trouble today when I changed my JUnit test to use >>>>> >>>>> @RunWith(**CamelSpringJUnit4ClassRunner.**class) from camel-spring-test >>>>> >>>>> It turned out that a transient dependency had resolved to: >>>>> org.springframework:spring-**beans:jar:3.0.7.RELEASE:**compile >>>>> >>>>> This one was correct however: >>>>> org.springframework:spring-**test:jar:3.1.1.RELEASE:test >>>>> >>>>> Looking at the dependency:tree for camel-spring and camel-test-spring >>>>> >>>>> +- org.apache.camel:camel-spring:**jar:2.10-SNAPSHOT:compile >>>>> | +- org.springframework:spring-**context:jar:3.0.7.RELEASE:**compile >>>>> | | +- org.springframework:spring-**beans:jar:3.0.7.RELEASE:**compile >>>>> | | +- org.springframework:spring-**core:jar:3.0.7.RELEASE:compile >>>>> | | | \- commons-logging:commons-**logging:jar:1.1.1:compile >>>>> | | +- org.springframework:spring-**expression:jar:3.0.7.RELEASE:** >>>>> compile >>>>> | | \- org.springframework:spring-**asm:jar:3.0.7.RELEASE:compile >>>>> | +- org.springframework:spring-**aop:jar:3.0.7.RELEASE:compile >>>>> | | \- aopalliance:aopalliance:jar:1.**0:compile >>>>> | \- org.springframework:spring-tx:**jar:3.0.7.RELEASE:compile >>>>> >>>>> +- org.apache.camel:camel-test-**spring:jar:2.10-SNAPSHOT:test >>>>> | \- org.springframework:spring-**test:jar:3.1.1.RELEASE:test >>>>> >>>>> Is this how it is supposed to be? >>>>> I can get around it by adding the transient spring-dependencies for >>>>> camel-spring to be declared explicitly. >>>>> Or am I missing something? >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> -- >>> Willem >>> ------------------------------**---- >>> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com >>> FuseSource >>> Web: http://www.fusesource.com >>> Blog: >>> http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English) >>> http://jnn.javaeye.com (Chinese) >>> Twitter: willemjiang >>> Weibo: willemjiang >>> >>> >> > > > > -- > Willem > ---------------------------------- > > CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com > FuseSource > Web: http://www.fusesource.com > Blog: http://willemjiang.blogspot.com (English) > > http://jnn.javaeye.com (Chinese) > Twitter: willemjiang > Weibo: willemjiang > -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: [hidden email] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ |
|
At present, the dependency tree looks like below (which is wrong):
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ camel-test-spring --- [INFO] org.apache.camel:camel-test-spring:bundle:2.10-SNAPSHOT [INFO] +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:compile [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.1:compile [INFO] | \- junit:junit:jar:4.10:compile [INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:compile [INFO] +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:compile [INFO] | +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile (version managed from 3.0.7.RELEASE) [INFO] | | +- org.springframework:spring-beans:jar:3.1.1.RELEASE:compile [INFO] | | +- org.springframework:spring-core:jar:3.1.1.RELEASE:compile [INFO] | | | \- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | | +- org.springframework:spring-expression:jar:3.1.1.RELEASE:compile [INFO] | | \- org.springframework:spring-asm:jar:3.1.1.RELEASE:compile [INFO] | +- org.springframework:spring-aop:jar:3.1.1.RELEASE:compile [INFO] | | \- aopalliance:aopalliance:jar:1.0:compile [INFO] | \- org.springframework:spring-tx:jar:3.1.1.RELEASE:compile (version managed from 3.0.7.RELEASE) [INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.4:test [INFO] | \- log4j:log4j:jar:1.2.16:test [INFO] \- org.springframework:spring-test:jar:3.1.1.RELEASE:compile After setting the scope to "provided" and only set the version of the spring-test dependency to 3.1.1.RELEASE, it looks like this: [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ camel-test-spring --- [INFO] org.apache.camel:camel-test-spring:bundle:2.10-SNAPSHOT [INFO] +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:compile [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.1:compile [INFO] | \- junit:junit:jar:4.10:compile [INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:compile [INFO] +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:compile [INFO] | +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile [INFO] | | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile [INFO] | | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile [INFO] | | | \- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | | +- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile [INFO] | | \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile [INFO] | | \- aopalliance:aopalliance:jar:1.0:compile [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile [INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.4:test [INFO] | \- log4j:log4j:jar:1.2.16:test [INFO] \- org.springframework:spring-test:jar:3.1.1.RELEASE:provided It looks good for me. What do you think? Best, Christian |
|
Sorry, forget my last comment...
I think we should let it is as it is. I created a sample application which depends on camel-sql and camel-test-spring. The dependency tree looks like below (dependency to org.springframework:spring-test:3.1.1.RELEASE): [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ loadbalancer-test --- [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile [INFO] | | +- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile [INFO] | +- aopalliance:aopalliance:jar:1.0:compile [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile [INFO] | \- org.springframework:spring-context:jar:3.0.7.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test [INFO] | | \- junit:junit:jar:4.10:test [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test [INFO] | +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test [INFO] | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test [INFO] \- log4j:log4j:jar:1.2.16:test If we declare the dependency to "org.springframework:spring-test:jar:3.1.1.RELEASE" in camel-test-spring as provided, my dependency tree looks like this (no dependency to org.springframework:spring-test at all): [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ loadbalancer-test --- [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile [INFO] | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile [INFO] | | +- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile [INFO] | +- aopalliance:aopalliance:jar:1.0:compile [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile [INFO] | \- org.springframework:spring-context:jar:3.0.7.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test [INFO] | | \- junit:junit:jar:4.10:test [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test [INFO] | \- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test [INFO] \- log4j:log4j:jar:1.2.16:test In case one, it will work out of the box without the need for the user to declare the dependency to org.springframework:spring-test. It's done by Maven and it's what the user expect, IMO. They may have to exclude the dependency to org.springframework:spring-test:3.1.1.RELEASE and to include the dependency to org.springframework:spring-test:3.0.7.RELEASE if they want to test with this version explicitly (no real need for this). In case two, the user has to define the dependency to org.springframework:spring-test:3.x.y.RELEASE to get this working. I think this is not what a Maven user expect to do. @Magnus: Do you have a real issue or did you just wondering about the different Spring versions? Best, Christian |
|
If the user doesn't use the CamelSpringUnit4ClassRunner from the
camel-test-spring, he doesn't need the spring-test:3.1.x. But if he needs it, he should consider to update the spring dependency version. When we upgrade the spring version to 3.1.x, these issues will go away. On Wed Apr 25 06:42:55 2012, Christian Müller wrote: > Sorry, forget my last comment... > I think we should let it is as it is. > > I created a sample application which depends on camel-sql and > camel-test-spring. The dependency tree looks like below (dependency to > org.springframework:spring-test:3.1.1.RELEASE): > > [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ > loadbalancer-test --- > [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT > [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile > [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile > [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile > [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > [INFO] | | +- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile > [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > [INFO] | +- aopalliance:aopalliance:jar:1.0:compile > [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-context:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test > [INFO] | | \- junit:junit:jar:4.10:test > [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test > [INFO] | +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test > [INFO] | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test > [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test > [INFO] \- log4j:log4j:jar:1.2.16:test > > > If we declare the dependency to > "org.springframework:spring-test:jar:3.1.1.RELEASE" in camel-test-spring as > provided, my dependency tree looks like this (no dependency to > org.springframework:spring-test at all): > > [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ > loadbalancer-test --- > [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT > [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile > [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile > [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile > [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > [INFO] | | +- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile > [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > [INFO] | +- aopalliance:aopalliance:jar:1.0:compile > [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-context:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test > [INFO] | | \- junit:junit:jar:4.10:test > [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test > [INFO] | \- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test > [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test > [INFO] \- log4j:log4j:jar:1.2.16:test > > In case one, it will work out of the box without the need for the user to > declare the dependency to org.springframework:spring-test. It's done by > Maven and it's what the user expect, IMO. They may have to exclude the > dependency to org.springframework:spring-test:3.1.1.RELEASE and to include > the dependency to org.springframework:spring-test:3.0.7.RELEASE if they > want to test with this version explicitly (no real need for this). > > In case two, the user has to define the dependency to > org.springframework:spring-test:3.x.y.RELEASE to get this working. I think > this is not what a Maven user expect to do. > > @Magnus: Do you have a real issue or did you just wondering about the > different Spring versions? > > Best, > Christian > -- Willem ---------------------------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang |
|
In reply to this post by Christian Mueller
I don't have an issue with it since I found the work-around.
It is more that it took me a couple of hours to figure it out (probably some of it due to inexperience since I first thought I had a problem with my application-context). And is Willem says it is an intermediate problem that will go away once you upgrade the rest to use the same version. Den 25 april 2012 00:42 skrev Christian Müller <[hidden email]> : > Sorry, forget my last comment... > I think we should let it is as it is. > > I created a sample application which depends on camel-sql and > camel-test-spring. The dependency tree looks like below (dependency to > org.springframework:spring-test:3.1.1.RELEASE): > > [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ > loadbalancer-test --- > [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT > [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile > [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile > [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile > [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > [INFO] | | +- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile > [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > [INFO] | +- aopalliance:aopalliance:jar:1.0:compile > [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-context:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test > [INFO] | | \- junit:junit:jar:4.10:test > [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test > [INFO] | +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test > [INFO] | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test > [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test > [INFO] \- log4j:log4j:jar:1.2.16:test > > > If we declare the dependency to > "org.springframework:spring-test:jar:3.1.1.RELEASE" in camel-test-spring as > provided, my dependency tree looks like this (no dependency to > org.springframework:spring-test at all): > > [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ > loadbalancer-test --- > [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT > [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile > [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile > [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile > [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > [INFO] | | +- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile > [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > [INFO] | +- aopalliance:aopalliance:jar:1.0:compile > [INFO] | +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-context:jar:3.0.7.RELEASE:compile > [INFO] | \- > org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test > [INFO] | | \- junit:junit:jar:4.10:test > [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test > [INFO] | \- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test > [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test > [INFO] \- log4j:log4j:jar:1.2.16:test > > In case one, it will work out of the box without the need for the user to > declare the dependency to org.springframework:spring-test. It's done by > Maven and it's what the user expect, IMO. They may have to exclude the > dependency to org.springframework:spring-test:3.1.1.RELEASE and to include > the dependency to org.springframework:spring-test:3.0.7.RELEASE if they > want to test with this version explicitly (no real need for this). > > In case two, the user has to define the dependency to > org.springframework:spring-test:3.x.y.RELEASE to get this working. I think > this is not what a Maven user expect to do. > > @Magnus: Do you have a real issue or did you just wondering about the > different Spring versions? > > Best, > Christian > |
|
I got it. If our user use camel-test-spring, he will likely do it by
annotating it with CamelSpringJUnit4ClassRunner or by extending CamelSpringTestSupport. For the first case, he needs spring-test, but not for the second one. If we didn't had to use Spring 3.1.x for this (say Spring 3.0.x would also work), we would define the dependency to spring-test, also if we need it only for case one. Because I cannot see any issue to declare the dependency to spring-test 3.1.x., I would like to leave it as it is. Otherwise our users have to care about it, if they want to use CamelSpringJUnit4ClassRunner. In addition, we have to remember to change the scope back in Camel 3.0.0 or 2.11.0 from provided to compile... Best, Christian 2012/4/25 Magnus Palmér <[hidden email]> > I don't have an issue with it since I found the work-around. > It is more that it took me a couple of hours to figure it out (probably > some of it due to inexperience since I first thought I had a problem with > my application-context). > And is Willem says it is an intermediate problem that will go away once you > upgrade the rest to use the same version. > > > Den 25 april 2012 00:42 skrev Christian Müller < > [hidden email]> > : > > > Sorry, forget my last comment... > > I think we should let it is as it is. > > > > I created a sample application which depends on camel-sql and > > camel-test-spring. The dependency tree looks like below (dependency to > > org.springframework:spring-test:3.1.1.RELEASE): > > > > [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ > > loadbalancer-test --- > > [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT > > [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile > > [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile > > [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile > > [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile > > [INFO] | +- > org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > > [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > > [INFO] | | +- > org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > > [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile > > [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > > [INFO] | +- aopalliance:aopalliance:jar:1.0:compile > > [INFO] | +- > org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > > [INFO] | \- > > org.springframework:spring-context:jar:3.0.7.RELEASE:compile > > [INFO] | \- > > org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > > [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > > [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test > > [INFO] | | \- junit:junit:jar:4.10:test > > [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test > > [INFO] | +- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test > > [INFO] | \- org.springframework:spring-test:jar:3.1.1.RELEASE:test > > [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test > > [INFO] \- log4j:log4j:jar:1.2.16:test > > > > > > If we declare the dependency to > > "org.springframework:spring-test:jar:3.1.1.RELEASE" in camel-test-spring > as > > provided, my dependency tree looks like this (no dependency to > > org.springframework:spring-test at all): > > > > [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ > > loadbalancer-test --- > > [INFO] org.apache.cmueller.camel:loadbalancer-test:jar:0.0.1-SNAPSHOT > > [INFO] +- org.apache.camel:camel-sql:jar:2.10-SNAPSHOT:compile > > [INFO] | +- org.apache.camel:camel-core:jar:2.10-SNAPSHOT:compile > > [INFO] | | \- org.slf4j:slf4j-api:jar:1.6.4:compile > > [INFO] | \- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile > > [INFO] | +- > org.springframework:spring-beans:jar:3.0.7.RELEASE:compile > > [INFO] | +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile > > [INFO] | | +- > org.springframework:spring-asm:jar:3.0.7.RELEASE:compile > > [INFO] | | \- commons-logging:commons-logging:jar:1.1.1:compile > > [INFO] | \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile > > [INFO] | +- aopalliance:aopalliance:jar:1.0:compile > > [INFO] | +- > org.springframework:spring-aop:jar:3.0.7.RELEASE:compile > > [INFO] | \- > > org.springframework:spring-context:jar:3.0.7.RELEASE:compile > > [INFO] | \- > > org.springframework:spring-expression:jar:3.0.7.RELEASE:compile > > [INFO] +- org.apache.camel:camel-test-spring:jar:2.10-SNAPSHOT:test > > [INFO] | +- org.apache.camel:camel-test:jar:2.10-SNAPSHOT:test > > [INFO] | | \- junit:junit:jar:4.10:test > > [INFO] | | \- org.hamcrest:hamcrest-core:jar:1.1:test > > [INFO] | \- org.apache.camel:camel-spring:jar:2.10-SNAPSHOT:test > > [INFO] \- org.slf4j:slf4j-log4j12:jar:1.6.4:test > > [INFO] \- log4j:log4j:jar:1.2.16:test > > > > In case one, it will work out of the box without the need for the user to > > declare the dependency to org.springframework:spring-test. It's done by > > Maven and it's what the user expect, IMO. They may have to exclude the > > dependency to org.springframework:spring-test:3.1.1.RELEASE and to > include > > the dependency to org.springframework:spring-test:3.0.7.RELEASE if they > > want to test with this version explicitly (no real need for this). > > > > In case two, the user has to define the dependency to > > org.springframework:spring-test:3.x.y.RELEASE to get this working. I > think > > this is not what a Maven user expect to do. > > > > @Magnus: Do you have a real issue or did you just wondering about the > > different Spring versions? > > > > Best, > > Christian > > > |
| Powered by Nabble | Edit this page |
