0

在我们的项目中,我们使用的是 Spring 3.0.0.RELEASE,现在我们正在尝试将 JBehave 添加到我们的项目中。
这里的问题是JBehave最新的 3.4.5(Release) 版本使用Spring 2.5.6 (spring-context, spring-test)。
然后我们在maven中遇到了依赖问题。

是否有任何解决方案可以继续使用 Spring 3.0 版和 Jbehave Spring 2.5.6 版继续我们的项目而没有任何冲突?

4

1 回答 1

3

JBehave 可能也适用于 Spring 3.0。您可以简单地尝试从 JBehave 中排除传递依赖。我没有对此进行测试,但它应该类似于:

<dependencyManagement>
    <dependencies>
    ...         
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.0</version>
            <scope>compile</scope>
        </dependency>
        ...
        <dependency>
            <groupId>org.jbehave</groupId>
            <artifactId>jbehave</artifactId>
            <version>3.4.5</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-context</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-test</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
     ....
  </dependencies>
</dependencyManagement>
于 2011-06-23T15:17:15.277 回答