# Maven工程创建

一、项目创建

1.1新建一个工程

image-20200131172614517.png

Next

image-20200131172728442.png

Next

image-20200131172914528.png

Next

image-20200131172941937.png

Finish

1.2 修改pom.xm文件

1.2.1 规范版本号


 UTF-8
 1.8
 1.8
 
 5.1.6.RELEASE
 
 3.4.6
 1.3.2
 4.11
 0.9.5.2
 6.1.0.jre8
 
 1.2
 2.2
 4.0.0
 
 2.4
 

1.2.2 增加依赖


 
 
 junit
 junit
 ${junit.version}
 test
 

 
 org.aspectj
 aspectjweaver
 1.6.8
 
 
 
 org.springframework
 spring-core
 ${spring.version}
 

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

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

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

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

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

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

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

 
 org.springframework
 spring-test
 ${spring.version}
 
 
 
 org.slf4j
 slf4j-api
 1.7.26
 

 
 org.slf4j
 slf4j-log4j12
 1.7.26
 
 
 javax.servlet
 javax.servlet-api
 ${javax.servlet-api.version}
 provided
 

 
 javax.servlet.jsp
 jsp-api
 ${jsp-api.version}
 

 
 javax.servlet
 jstl
 ${jstl.version}
 
 
 org.mybatis
 mybatis
 ${mybatis.version}
 
 
 org.mybatis
 mybatis-spring
 ${mybatis-spring.version}
  
 
 
 com.mchange
 c3p0
 ${c3p0.version}
 
 
 
 net.sf.json-lib
 json-lib
 ${json-lib.version}
 jdk15
 
 
 com.microsoft.sqlserver
 mssql-jdbc
 ${mssql-jdbc.version}
 

1.3 增加目录结构

增加 文档目录doc、代码目录java、资源目录resources、测试目录test、测试资源目录testresources

image-20200131175124249.png
image-20200131175744582.png
image-20200131180001094.png
image-20200131181007577.png

1.4 配置web.xml文件

Archetype Created Web Application
 contextConfigLocation
 classpath:applicationContext.xml
 
 org.springframework.web.context.ContextLoaderListener
 
​
​
 
 dispatcher
 org.springframework.web.servlet.DispatcherServlet
 
 contextConfigLocation
 classpath:dispatcher-servlet.xml
 
 1
 

 
 dispatcher
 /
 
 
 CharacterEncodingFilter
 org.springframework.web.filter.CharacterEncodingFilter
 
 encoding
 UTF-8
 
 
 
 CharacterEncodingFilter
 /*
 

1.5 配置 applicationContext.xml 文件



​
​
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
​
​
 
 
 
 
 
 
 
 
 


1.6 配置 dispatcher-servlet.xml



 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

1.7 创建静态资源目录

创建目录 statics、statics\css、statics\js、statics\images、views。

[图片上传失败...(image-97d38b-1580957805533)]

二、项目发布

image-20200131181528164.png

增加tomcat server/local

image-20200131181616090.png

输入项目名称和指定发布信息

image-20200131182627856.png

Apply

你可能感兴趣的:(# Maven工程创建)