我刚发现一件令人生畏的事情。有两个版本的spring依赖坐标。
Project依赖于spring mvc和spring flow。有两组并行的依赖项。
Spring MVC具有以下方案的依赖关系:org.springframework:spring-asm
。
Spring Flow具有以下方案的依赖关系:org.springfrmaework:org.springframework.asm
。
为什么有两个不同的相同依赖集?如何克服?
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>org.springframework.webflow</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.4.RELEASE</version>
</dependency>
答案 0 :(得分:3)
这基本上是你正在使用的工件的问题:
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>org.springframework.webflow</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
来自SpringSource Enterprise Bundle Repository的工件和那些工件是否符合OSGi。我引用:
欢迎使用SpringSource Bundle Repository。在这里你会发现 数百个开源企业库的OSGi就绪版本 在开发Spring应用程序时常用的。
另一方面,你有:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.4.RELEASE</version>
</dependency>
是来自the maven repository的标准工件。
是用于OSGi的asm工件的修补版本。
解决此问题的最佳解决方案是仅使用SEBR存储库工件。
我推荐这个,因为有一次我从maven中央回购中遇到了问题(它们已经损坏了)所以我尝试使用SEBR来解决任何弹簧问题。但我引用from the documentation:
如果OSGi对你无关紧要,那么这两个地方都有效 他们之间的一些利弊。一般来说,选择一个地方或 其他你的项目;不要混合它们。这是特别的 因为EBR工件必然使用不同的命名 约定比Maven Central工件。