Peter,

the jbehave-maven-plugin is not coupled with jbehave-spring.

If you want to use Spring 3.0.5 instead of 2.5.6, all you need to do is
use dependency management to override the transitive dependency.

I've modified the trader-spring example pom.xml to show this in action.

https://github.com/jbehave/jbehave-core/blob/master/examples/trader-spring/pom.xml

If you run:

mvn dependency:tree -Dspring.version=3.0.5.RELEASE

you'll see that the 2.5.6 version is overridden with 3.0.5.

Note that you should not configure your dependencies at the plugin
level, rather at the POM level.

The spring trader example runs fine with both Spring 2.5.x and 3.0.x -
as well as mvn  2.2.1 and mvn 3.0.2.

Cheers

On 25/03/2011 21:43, Peter Suggitt wrote:
> From:         Peter Suggitt <[email protected]>
> Reply-to:     [email protected]
> To:   [email protected]
> Subject:      Spring 3.0.5 & Maven 3.0 integration - uses spring 2.5.6
> transitively
> Date:         Fri, 25 Mar 2011 20:40:02 +0000
>
>
> Hi Mauro et al
>
> Firstly, I am a big fan of what you guys are doing and what you have
> produced here.
>
> I have a small problem though.  I am using JBehave 3.2 with the maven
> plugin to test a library that uses Spring 3.0.5.  My application POM
> defines Spring 3.0.5 libraries as dependencies, yet when I run JBehave I
> am finding that the jbehave-spring library is bringing in a transitive
> Spring 2.5.6 dependency.  This manifests itself in my JBehave runtime
> now having spring 2.5.6 in its classloader rather than the hoped for
> spring 3.0.5 dependency.
>
> When I set the jbehave-maven-plugin to depend on spring 3.0.5
> (overriding the jbehave-spring pom) I get an issue with the a Format
> class (now Abstract in spring 3).
>
> Key thing for me in this is that the jbehave-spring library coupled with
> the jbehave-maven-plugin means that the runtime tests are being run with
> spring 2.5.6.  Clearly this is not desired behaviour given that this
> implies using a jbehave defined spring version rather than the one from
> my POM.
>
> Happy to share code/poms etc with you to help find an answer.
>
> Would love to hear your thoughts/advice on this one.
>
>
> Kind regards
> Pete Suggitt
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email


Reply via email to