firemail
标题:
maven 下配置spring
[打印本页]
作者:
java
时间:
2017-3-27 17:02
标题:
maven 下配置spring
本帖最后由 java 于 2017-3-27 17:06 编辑
查看mvn安装路径
mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/programs/apache-maven-3.3.9
....
主要相关配置文件
.conf/settings.xml
根据pom继承的特性,在父项目的pom.xml中加入对spring的依赖
<!--spring-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
.....
在具项目的web.xml中指定spring的配置文件
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/*.xml</param-value>
</context-param>
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3