maven项目的搭建——maven搭建spring mvc+ibatis项目(一)

[b][size=medium]怎么使用maven搭建spring mvc+ibatis框架项目呢?[/size][/b]
首先,一览实例项目的总体,如图:
[img]http://dl.iteye.com/upload/picture/pic/131889/0027c1ab-d05b-3730-94d7-674fa6a37c3f.png[/img]


[b][size=medium]1、怎么建立一个maven项目呢?[/size][/b]
新建Project--maven project,其他如下图所示:
[img]http://dl.iteye.com/upload/picture/pic/131891/d39934a3-6316-35ac-bd12-2b50b1ccbcdf.png[/img]

[img]http://dl.iteye.com/upload/picture/pic/131893/390ef819-0854-3174-9ad7-32cb46895c97.png[/img]

[b][size=medium]2、在pom.xml中引入项目的所需要的jar包和编译的设置。[/size][/b]
主要需要引入的有:
[b]1)spring mvc相关的spring3.0以上的jar包
2)ibatis的jar包
3)数据库和数据库连接池应用的相关jar包,数据库是使用mysql的,采用dbcp连接方式
4)struts的json jar包
5)j2ee相关jar包[/b]

以下是项目的pom.xml文件内容,可供参考:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
com.bluedon.ibatis
ibatis-root
0.0.1-SNAPSHOT
ibatis-root Maven Webapp
http://maven.apache.org
war




2.2.3
3.1.1.RELEASE
2.0.8
1.7.5
1.8.4





junit
junit
3.8.1
test




javax.servlet
javax.servlet-api
3.0.1



javax.servlet.jsp
jsp-api
2.0




mysql
mysql-connector-java
5.1.27




commons-dbcp
commons-dbcp
1.4




org.apache.struts
struts2-json-plugin
2.3.8




org.springframework
spring-web
${springframework.version}



org.springframework
spring-webmvc
${springframework.version}



org.springframework
spring-context
${springframework.version}



org.springframework
spring-aop
${springframework.version}



org.springframework
spring-core
${springframework.version}



org.springframework
spring-test
${springframework.version}



org.springframework
spring-tx
${springframework.version}



org.springframework
spring-beans
${springframework.version}



org.springframework
spring-jdbc
${springframework.version}




org.springframework
spring-ibatis
${ibatis.version}



org.apache.ibatis
ibatis-sqlmap
2.3.4.726




org.slf4j
slf4j-api
${slf4j.version}


org.slf4j
slf4j-log4j12
${slf4j.version}


org.slf4j
log4j-over-slf4j
${slf4j.version}


org.slf4j
jcl-over-slf4j
${slf4j.version}




org.codehaus.jackson
jackson-mapper-asl
${jackson.version}


org.codehaus.jackson
jackson-core-asl
${jackson.version}








org.apache.maven.plugins
maven-eclipse-plugin


/batis_root



org.eclipse.wst.common.project.facet.core.builder





org.eclipse.wst.common.modulecore.ModuleCoreNature
org.eclipse.wst.common.project.facet.core.nature


org.eclipse.jdt.launching.JRE_CONTAINER

2.0






org.apache.maven.plugins
maven-war-plugin

src/main/webapp/WEB-INF/web.xml



org.eclipse.m2e
lifecycle-mapping
1.0.0





org.apache.maven.plugins
maven-dependency-plugin
[2.0,)

copy-dependencies
unpack-dependencies












org.apache.maven.plugins
maven-compiler-plugin
2.5.1

1.6
1.6








相关maven服务器的搭建和pom.xml标签语法的使用可参见相关的文章。

你可能感兴趣的:(maven搭建spring,mvc+ibatis)