maven 命令創建 web 骨架項目

web.xml 要修改成 3.1
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> </web-app>
把沒有的目錄補全
ex: src/main/java、src/test/java、src/test/resources
mvn创建的最后一个参数表示使用mvn的原型
webapp的原型来创建项目
用Maven命令创建web项目

# maven3.0.5以下
mvn archetype:generate \
-DgroupId=org.seckill \
-DartifactId=seckill \
-DarchetypeArtifactId=maven-archetype-webapp
# maven3.0.5及以上
mvn archetype:generate \
-DgroupId=org.seckill \
-DartifactId=seckill \
-DarchetypeArtifactId=maven-archetype-webapp
配置官网地址
slf4j+logback-classic & mysql驱动
官网资源地址
mvn archetype:create -DgroupId=org.seckill -DartifactId=seckill -DarchetypeArtifactId=maven-archetype-webapp
-DgroupId=org.seckill -DartifactId=seckill:标注项目的坐标
org.seckill:项目名
-DarchetypeArtifactId=maven-archetype-webapp:使用webapp原型去创建项目
使用以上命令项目创建失败
maven命令创建web骨架项目
logback配置:http://logback.qos.ch/manual/configuration.html
spring配置:http://docs.spring.io/spring/doc
mybatis配置:http://mybatis.github.io/mybatis-3/zh/index.html
官网地址
1、logback配置
2、spring配置
3、mybatis配置
官网配置地址
相关文档官网地址
单元测试需要spring的yilai(sprngtest),junit也是写单元测试需要的,slf4是接口规范,驱动是工作中用到所以runtime,数据库连接池优化数据库操作
springtx事务的依赖
数据库相关依赖(驱动connector)
4:pring依赖 3)Spring web相关依赖
4)Spring web相关依赖
dao框架依赖
1日志依赖
使用junut4
官网资源地址
logback配置:http://logback.qos.ch/manual/configuration.html spring配置:http://docs.spring.io/spring/docs/ mybatis配置:http://mybatis.github.io/mybatis-3/zh/index.html
补全项目依赖
1.日志:
2.数据库:
3.DAO框架:Mybatis依赖
4.Servlet web相关依赖
5.Spring依赖:
通过官网查找相关配置,记录官网地址
官网资源地址
logback配置:http://logback.qos.ch/manual/configuration.html spring配置:http://docs.spring.io/spring/docs/ mybatis配置:http://mybatis.github.io/mybatis-3/zh/index.html