初识spring boot maven管理--配置文件(一)

2014-11-23 23:19:25 · 作者: · 浏览: 2

web环境下修改信息需要重启服务器,如果在一个大型的项目中经常重启服务器,那浪费的时间可想而知,今天介绍个好东西 --spring boot!一般学习都是从hello world开始学习的!下面介绍springboot 在maven配置和使用!

先进行pom.xml配置,

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
authentication
ammaven
war
0.0.1-SNAPSHOT
ammaven Maven Webapp
http://maven.apache.org

UTF-8
4.0.3.RELEASE
3.8.1
2.4


org.springframework.boot
spring-boot-starter-parent
1.0.1.RELEASE





org.springframework.boot
spring-boot-starter-web


commons-fileupload
commons-fileupload
1.3.1




commons-io
commons-io
${common-io}




junit
junit
${junitversion}
test


org.springframework
spring-aop
${springversion}
jar
compile


org.springframework
spring-aspects
${springversion}
jar
compile


org.springframework
spring-beans
${springversion}
jar
compile


org.springframework
spring-context
${springversion}
jar
compile


org.springframework
spring-context-support
${springversion}
jar
compile


org.springframework
spring-core
${springversion}
jar
compile


org.springframework
spring-expression
${springversion}
jar
compile


org.springframework
spring-jdbc
${springversion}
jar
compile


org.springframework
spring-jms
${springversion}
jar
compile


org.springframework
spring-orm
${springversion}
jar
compile


org.springframework
spring-oxm
${springversion}
jar
compile


org.springframework
spring-tx
${springversion}
jar
compile


org.springframework
spring-web
${springversion}
jar
compile


org.springframework
spring-webmvc
${springversion}
jar
compile


org.springframework
spring-test
${springversion}
jar
compile




javax.servlet
jstl
1.2
jar
compile




commons-collections
commons-collections
3.1




commons-logging
commons-logging
1.1





ammaven

下载完依赖的jar包下面开始配置spring和springMVC

首先配置和applicationContext.xml


xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">





class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">




classpath:log4j.properties