java maven spring_maven搭建spring项目(图文教程)

开发工具:MyEclipse2014版(jdk1.7)+Maven3.9。

新建Maven项目:

Step1:

54dc6a60635dc5f351cc97fb81b11b66.png

Step2:

70b48667d372b0ce2b5bd72cad6a2992.png

Step3:这里选maven-archetype-webapp,因为后面的项目讲解都是web项目。如果是纯java项目,可以选择 maven-archetype-quickstart。

92fcfbe5352cbac8fa6b62e140fc412a.png

Step4:

551743087081988527bb074c7e7c5bec.png

Step5:右键项目,build path,修改jdk运行环境。

729d671561c523457d14f519b9c369fa.png

到这里,maven的web项目初建完毕。

修改:pom.xml

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

4.0.0

com.elstar

spring

war

0.0.1-SNAPSHOT

spring Maven Webapp

http://maven.apache.org

UTF-8

4.12

4.3.3.RELEASE

junit

junit

${junit.version}

test

org.springframework

spring-context

${spring.version}

org.springframework

spring-test

${spring.version}

spring

添加spring配置文件:src/main/resources/applicationContext.xml

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:p="http://www.springframework.org/schema/p"

xmlns:aop="http://www.springframework.org/schema/aop"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:jee="http://www.springframework.org/schema/jee"

xmlns:tx="http://www.springframework.org/schema/tx"

xsi:schemaLocation="

http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd

http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">

以上这篇maven搭建spring项目(图文教程)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值