标签:框架 images 导入 frame manage text 冲突 class framework
1、传递依赖冲突解决
<dependencies> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.3.30</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.2.4.RELEASE</version> </dependency> </dependencies>
<!-- 版本锁定:指定项目中依赖的版本
dependencyManagement只会锁定版本号,并不会产生依赖jar包
-->
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.2.4.RELEASE</version> </dependency> </dependencies> </dependencyManagement>
<!-- 版本锁定:指定项目中依赖的版本 --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.2.4.RELEASE</version> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.3.30</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.2.4.RELEASE</version> </dependency> </dependencies>
【注意】:如果按照这种方式的话,将来spring框架升级了,那么我就需要在每个spring的jar包的版本哪里修改,太麻烦了,怎么办?将版本,设置到一个地方,就是提取版本号设置到属性标签中。
<!-- 属性 --> <properties> <spring.version>4.2.4.RELEASE</spring.version> <hibernate.version>5.0.7.Final</hibernate.version> <struts.version>2.3.24</struts.version> </properties> <!-- 版本锁定:指定项目中依赖的版本 ,并不会产生依赖jar包 --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> </dependencies> </dependencyManagement>
2、通过maven整合SSH框架
3、通过maven对项目进行拆分、聚合
4、私服应用
标签:框架 images 导入 frame manage text 冲突 class framework
原文地址:http://www.cnblogs.com/xuweiweiailixing/p/6848697.html