淘淘商城的第一天

学习视频下载路劲: 链接: https://pan.baidu.com/s/1GnkfbJyHMZ1-unk-xkiVAw 提取码: brn4 

1 课程计划

一共14天课程

1、第一天:电商行业的背景。淘淘商城的介绍。搭建项目工程。Svn的使用。

2、第二天:框架的整合。后台管理商品列表的实现。分页插件。

3、第三天:后台管理。商品添加。商品类目的选择、图片上传、富文本编辑器的使用。

4、第四天:商品规格的实现。

5、第五天:商城前台系统的搭建。首页商品分类的展示。Jsonp。

6、第六天:cms系统的实现。前台大广告位的展示。

7、第七天:cms系统添加缓存。Redis。缓存同步。

8、第八天:搜索功能的实现。使用solr实现搜索。

9、第九天:商品详情页面的展示。

10、第十天:单点登录系统。Session共享。

11、第十一天:购物车订单系统的实现。

12、第十二天:nginx。反向代理工具。

13、第十三天:redis集群的搭建、solr集群的搭建。系统的部署。

14、项目总结。

今天的内容:

1、电商行业的背景。

2、淘淘商城的介绍。

3、工程项目的搭建。

4、Svn的使用。

1 电商行业介绍

1.1 电商行业发展

近年来,中国的电子商务快速发展,交易额连创新高,电子商务在各领域的应用不断拓展和深化、相关服务业蓬勃发展、支撑体系不断健全完善、创新的动力和能力 不断增强。电子商务正在与实体经济深度融合,进入规模性发展阶段,对经济社会生活的影响不断增大,正成为我国经济发展的新引擎。

中国电子商务研究中心数据显示,截止到2012年底,中国电子商务市场交易规模达7.85万亿人民币,同比增长30.83%。其中,B2B电子商务交易额 达6.25万亿,同比增长27%。而2011年全年,中国电子商务市场交易额达6万亿人民币,同比增长33%,占GDP比重上升到13%;2012年,电 子商务占GDP的比重已经高达15%。预计2013年我国电子商务规模将突破十万亿大关。

clip_image002

图1.2009-2014年中国电子商务市场交易规模(万亿元)

1.2 11.11

clip_image003

clip_image004

1.3 电商行业技术特点

Ø 技术新

Ø 技术范围广

Ø 分布式

Ø 高并发、集群、负载均衡、高可用

Ø 海量数据

Ø 业务复杂

Ø 系统安全

1 淘淘商城

1.1 淘淘商城简介

1.1.1 电商行业的模式:

B2B:企业到企业,商家到商家。代表:阿里巴巴、慧聪网。

B2C:商家到客户。代表:京东、淘宝商城(B2B2C)。

C2C:客户到客户。淘宝集市。

O2O:线上到线下。

1.1.2 淘淘商城的模式

淘淘网上商城是一个综合性的B2C平台,类似京东商城、天猫商城。会员可以在商城浏览商品、下订单,以及参加各种活动。

管理员、运营可以在平台后台管理系统中管理商品、订单、会员等。

客服可以在后台管理系统中处理用户的询问以及投诉。

1.2 功能模块

clip_image002

1.2.1 功能描述

后台管理系统:管理商品、订单、类目、商品规格属性、用户管理以及内容发布等功能。

前台系统:用户可以在前台系统中进行注册、登录、浏览商品、首页、下单等操作。

会员系统:用户可以在该系统中查询已下的订单、收藏的商品、我的优惠券、团购等信息。

订单系统:提供下单、查询订单、修改订单状态、定时处理订单。

搜索系统:提供商品的搜索功能。

单点登录系统:为多个系统之间提供用户登录凭证以及查询登录用户的信息。

1.1 技术架构

1.1.1 传统架构

clip_image002[5]

思考:有什么问题?

1、 模块之间耦合度太高,其中一个升级其他都得升级

2、 开发困难,各个团队开发最后都要整合一起

3、 系统的扩展性差

4、 不能灵活的进行分布式部署。

解决方法:

优点:

把模块拆分成独立的工程,单点运行。如果某一个点压力大可以对这一个点单独增加配置。其他的点不受影响。

缺点:

系统之间交互需要额外的工作量来进行接口的开发。

把系统拆分成多个工程,要完成系统的工程需要多个工程协作完成。这种形式叫做分布式。

1.1.2 分布式的架构

clip_image004

分布式架构:

把系统按照模块拆分成多个子系统。

优点:

1、把模块拆分,使用接口通信,降低模块之间的耦合度。

2、把项目拆分成若干个子项目,不同的团队负责不同的子项目。

3、增加功能时只需要再增加一个子项目,调用其他系统的接口就可以。

4、可以灵活的进行分布式部署。

缺点:

系统之间交互需要使用远程通信,接口开发增加工作量。

1.1.1 技术选型(主要技术)

  1 l Spring、SpringMVC、Mybatis
  2 
  3 l JSP、JSTL、jQuery、jQuery plugin、EasyUI、KindEditor(富文本编辑器)、CSS+DIV
  4 
  5 l Redis(缓存服务器)
  6 
  7 l Solr(搜索)
  8 
  9 l httpclient(调用系统服务)
 10 
 11 l Mysql
 12 
 13 l Nginx(web服务器)
 14 
View Code

1.1.2 开发工具和环境

Eclipse 4.5.0(Mars),自带maven插件,需要手工安装svn插件。

Maven 3.3.3(开发工具自带)

Tomcat 7.0.53(Maven Tomcat Plugin)

JDK 1.7

Mysql 5.6

Nginx 1.8.0

Redis 3.0.0

Win7 操作系统

SVN(版本管理)

1.2 人员配置

产品经理:3人,确定需求以及给出产品原型图。

项目经理:1人,项目管理。

前端团队:5人,根据产品经理给出的原型制作静态页面。

后端团队:20人,实现产品功能。

测试团队:5人,测试所有的功能。

运维团队:3人,项目的发布以及维护。

后台管理系统工程搭建

Maven

1、依赖管理、jar包、工程之间的依赖。

2、项目构建。实现项目的一步构建。

3、工程聚合、继承、依赖。

Maven的工程类型:

1、war包工程

2、Jar包工程

3、Pom工程。

父工程的搭建

父工程应该是一个pom工程。在父工程中定义依赖的jar包的版本信息。Maven插件的版本。

 

安装本地仓库

clip_image002[7]

使用.m2覆盖本地仓库的内容。

clip_image004[5]

 资源包下载路劲    链接:http://pan.baidu.com/s/1kVBUF6R 密码:z73d

创建maven工程

clip_image002[9]

clip_image004[7]

修改pom文件

  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 	<modelVersion>4.0.0</modelVersion>
  4 	<groupId>com.taotao</groupId>
  5 	<artifactId>taotao-parent</artifactId>
  6 	<version>0.0.1-SNAPSHOT</version>
  7 	<packaging>pom</packaging>
  8 	<!-- 集中定义依赖版本号 -->
  9 	<properties>
 10 		<junit.version>4.12</junit.version>
 11 		<spring.version>4.1.3.RELEASE</spring.version>
 12 		<mybatis.version>3.2.8</mybatis.version>
 13 		<mybatis.spring.version>1.2.2</mybatis.spring.version>
 14 		<mybatis.paginator.version>1.2.15</mybatis.paginator.version>
 15 		<mysql.version>5.1.32</mysql.version>
 16 		<slf4j.version>1.6.4</slf4j.version>
 17 		<jackson.version>2.4.2</jackson.version>
 18 		<druid.version>1.0.9</druid.version>
 19 		<httpclient.version>4.3.5</httpclient.version>
 20 		<jstl.version>1.2</jstl.version>
 21 		<servlet-api.version>2.5</servlet-api.version>
 22 		<jsp-api.version>2.0</jsp-api.version>
 23 		<joda-time.version>2.5</joda-time.version>
 24 		<commons-lang3.version>3.3.2</commons-lang3.version>
 25 		<commons-io.version>1.3.2</commons-io.version>
 26 		<commons-net.version>3.3</commons-net.version>
 27 		<pagehelper.version>3.4.2-fix</pagehelper.version>
 28 		<jsqlparser.version>0.9.1</jsqlparser.version>
 29 		<commons-fileupload.version>1.3.1</commons-fileupload.version>
 30 		<jedis.version>2.7.2</jedis.version>
 31 		<solrj.version>4.10.3</solrj.version>
 32 	</properties>
 33 	<!-- 只定义依赖的版本,并不实际依赖 -->
 34 	<dependencyManagement>
 35 		<dependencies>
 36 			<!-- 时间操作组件 -->
 37 			<dependency>
 38 				<groupId>joda-time</groupId>
 39 				<artifactId>joda-time</artifactId>
 40 				<version>${joda-time.version}</version>
 41 			</dependency>
 42 			<!-- Apache工具组件 -->
 43 			<dependency>
 44 				<groupId>org.apache.commons</groupId>
 45 				<artifactId>commons-lang3</artifactId>
 46 				<version>${commons-lang3.version}</version>
 47 			</dependency>
 48 			<dependency>
 49 				<groupId>org.apache.commons</groupId>
 50 				<artifactId>commons-io</artifactId>
 51 				<version>${commons-io.version}</version>
 52 			</dependency>
 53 			<dependency>
 54 				<groupId>commons-net</groupId>
 55 				<artifactId>commons-net</artifactId>
 56 				<version>${commons-net.version}</version>
 57 			</dependency>
 58 			<!-- Jackson Json处理工具包 -->
 59 			<dependency>
 60 				<groupId>com.fasterxml.jackson.core</groupId>
 61 				<artifactId>jackson-databind</artifactId>
 62 				<version>${jackson.version}</version>
 63 			</dependency>
 64 			<!-- httpclient -->
 65 			<dependency>
 66 				<groupId>org.apache.httpcomponents</groupId>
 67 				<artifactId>httpclient</artifactId>
 68 				<version>${httpclient.version}</version>
 69 			</dependency>
 70 			<!-- 单元测试 -->
 71 			<dependency>
 72 				<groupId>junit</groupId>
 73 				<artifactId>junit</artifactId>
 74 				<version>${junit.version}</version>
 75 				<scope>test</scope>
 76 			</dependency>
 77 			<!-- 日志处理 -->
 78 			<dependency>
 79 				<groupId>org.slf4j</groupId>
 80 				<artifactId>slf4j-log4j12</artifactId>
 81 				<version>${slf4j.version}</version>
 82 			</dependency>
 83 			<!-- Mybatis -->
 84 			<dependency>
 85 				<groupId>org.mybatis</groupId>
 86 				<artifactId>mybatis</artifactId>
 87 				<version>${mybatis.version}</version>
 88 			</dependency>
 89 			<dependency>
 90 				<groupId>org.mybatis</groupId>
 91 				<artifactId>mybatis-spring</artifactId>
 92 				<version>${mybatis.spring.version}</version>
 93 			</dependency>
 94 			<dependency>
 95 				<groupId>com.github.miemiedev</groupId>
 96 				<artifactId>mybatis-paginator</artifactId>
 97 				<version>${mybatis.paginator.version}</version>
 98 			</dependency>
 99 			<dependency>
100 				<groupId>com.github.pagehelper</groupId>
101 				<artifactId>pagehelper</artifactId>
102 				<version>${pagehelper.version}</version>
103 			</dependency>
104 			<!-- MySql -->
105 			<dependency>
106 				<groupId>mysql</groupId>
107 				<artifactId>mysql-connector-java</artifactId>
108 				<version>${mysql.version}</version>
109 			</dependency>
110 			<!-- 连接池 -->
111 			<dependency>
112 				<groupId>com.alibaba</groupId>
113 				<artifactId>druid</artifactId>
114 				<version>${druid.version}</version>
115 			</dependency>
116 			<!-- Spring -->
117 			<dependency>
118 				<groupId>org.springframework</groupId>
119 				<artifactId>spring-context</artifactId>
120 				<version>${spring.version}</version>
121 			</dependency>
122 			<dependency>
123 				<groupId>org.springframework</groupId>
124 				<artifactId>spring-beans</artifactId>
125 				<version>${spring.version}</version>
126 			</dependency>
127 			<dependency>
128 				<groupId>org.springframework</groupId>
129 				<artifactId>spring-webmvc</artifactId>
130 				<version>${spring.version}</version>
131 			</dependency>
132 			<dependency>
133 				<groupId>org.springframework</groupId>
134 				<artifactId>spring-jdbc</artifactId>
135 				<version>${spring.version}</version>
136 			</dependency>
137 			<dependency>
138 				<groupId>org.springframework</groupId>
139 				<artifactId>spring-aspects</artifactId>
140 				<version>${spring.version}</version>
141 			</dependency>
142 			<!-- JSP相关 -->
143 			<dependency>
144 				<groupId>jstl</groupId>
145 				<artifactId>jstl</artifactId>
146 				<version>${jstl.version}</version>
147 			</dependency>
148 			<dependency>
149 				<groupId>javax.servlet</groupId>
150 				<artifactId>servlet-api</artifactId>
151 				<version>${servlet-api.version}</version>
152 				<scope>provided</scope>
153 			</dependency>
154 			<dependency>
155 				<groupId>javax.servlet</groupId>
156 				<artifactId>jsp-api</artifactId>
157 				<version>${jsp-api.version}</version>
158 				<scope>provided</scope>
159 			</dependency>
160 			<!-- 文件上传组件 -->
161 			<dependency>
162 				<groupId>commons-fileupload</groupId>
163 				<artifactId>commons-fileupload</artifactId>
164 				<version>${commons-fileupload.version}</version>
165 			</dependency>
166 			<!-- Redis客户端 -->
167 			<dependency>
168 				<groupId>redis.clients</groupId>
169 				<artifactId>jedis</artifactId>
170 				<version>${jedis.version}</version>
171 			</dependency>
172 			<!-- solr客户端 -->
173 			<dependency>
174 				<groupId>org.apache.solr</groupId>
175 				<artifactId>solr-solrj</artifactId>
176 				<version>${solrj.version}</version>
177 			</dependency>
178 		</dependencies>
179 	</dependencyManagement>
180 	<build>
181 		<finalName>${project.artifactId}</finalName>
182 		<plugins>
183 			<!-- 资源文件拷贝插件 -->
184 			<plugin>
185 				<groupId>org.apache.maven.plugins</groupId>
186 				<artifactId>maven-resources-plugin</artifactId>
187 				<version>2.7</version>
188 				<configuration>
189 					<encoding>UTF-8</encoding>
190 				</configuration>
191 			</plugin>
192 			<!-- java编译插件 -->
193 			<plugin>
194 				<groupId>org.apache.maven.plugins</groupId>
195 				<artifactId>maven-compiler-plugin</artifactId>
196 				<version>3.2</version>
197 				<configuration>
198 					<source>1.7</source>
199 					<target>1.7</target>
200 					<encoding>UTF-8</encoding>
201 				</configuration>
202 			</plugin>
203 		</plugins>
204 		<pluginManagement>
205 			<plugins>
206 				<!-- 配置Tomcat插件 -->
207 				<plugin>
208 					<groupId>org.apache.tomcat.maven</groupId>
209 					<artifactId>tomcat7-maven-plugin</artifactId>
210 					<version>2.2</version>
211 				</plugin>
212 			</plugins>
213 		</pluginManagement>
214 	</build>
215 </project>
216 

创建一个common工程

也需要继承taotao-parent工程。

创建工程

clip_image002[11]

Pom文件
  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 	<modelVersion>4.0.0</modelVersion>
  4 	<parent>
  5 		<groupId>com.taotao</groupId>
  6 		<artifactId>taotao-parent</artifactId>
  7 		<version>0.0.1-SNAPSHOT</version>
  8 	</parent>
  9 	<groupId>com.taotao</groupId>
 10 	<artifactId>taotao-common</artifactId>
 11 	<version>0.0.1-SNAPSHOT</version>
 12 	<!-- jar包的依赖 -->
 13 	<dependencies>
 14 		<!-- 时间操作组件 -->
 15 		<dependency>
 16 			<groupId>joda-time</groupId>
 17 			<artifactId>joda-time</artifactId>
 18 		</dependency>
 19 		<!-- Apache工具组件 -->
 20 		<dependency>
 21 			<groupId>org.apache.commons</groupId>
 22 			<artifactId>commons-lang3</artifactId>
 23 		</dependency>
 24 		<dependency>
 25 			<groupId>org.apache.commons</groupId>
 26 			<artifactId>commons-io</artifactId>
 27 		</dependency>
 28 		<dependency>
 29 			<groupId>commons-net</groupId>
 30 			<artifactId>commons-net</artifactId>
 31 		</dependency>
 32 		<!-- Jackson Json处理工具包 -->
 33 		<dependency>
 34 			<groupId>com.fasterxml.jackson.core</groupId>
 35 			<artifactId>jackson-databind</artifactId>
 36 		</dependency>
 37 		<!-- httpclient -->
 38 		<dependency>
 39 			<groupId>org.apache.httpcomponents</groupId>
 40 			<artifactId>httpclient</artifactId>
 41 		</dependency>
 42 		<!-- 单元测试 -->
 43 		<dependency>
 44 			<groupId>junit</groupId>
 45 			<artifactId>junit</artifactId>
 46 			<scope>test</scope>
 47 		</dependency>
 48 		<!-- 日志处理 -->
 49 		<dependency>
 50 			<groupId>org.slf4j</groupId>
 51 			<artifactId>slf4j-log4j12</artifactId>
 52 		</dependency>
 53 	</dependencies>
 54 </project>
 55 

后台管理工程创建

搭建一个聚合工程:

1.1.1 工程结构

传统工程结构:

 
  clip_image001

Maven管理的工程结构:

不使用maven:工程部署时需要手动复制jar包。完成工程构建。非常繁琐。

使用maven进行工程构建:

使用maven可以实现一步构建。

image

 
   

clip_image003[1]继承:

clip_image004[1]依赖:

后台管理系统工程结构:

taotao-parent -- 管理依赖jar包的版本,全局,公司级别

|--taotao-common --- 通用组件、工具类

|--taotao-manage -- 后台系统

|--com.taotao.manage.web

|--com.taotao.manage.service

|--com.taotao.manage.mapper

|--com.taotao.manage.pojo

Taotao-manager工程

1.1.1.1 工程搭建

clip_image002[3]

1.1.1.2 修改pom文件
  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 	<modelVersion>4.0.0</modelVersion>
  4 	<parent>
  5 		<groupId>com.taotao</groupId>
  6 		<artifactId>taotao-parent</artifactId>
  7 		<version>0.0.1-SNAPSHOT</version>
  8 	</parent>
  9 	<groupId>com.taotao</groupId>
 10 	<artifactId>taotao-manager</artifactId>
 11 	<version>0.0.1-SNAPSHOT</version>
 12 	<packaging>pom</packaging>
 13 	<!-- 依赖管理 -->
 14 	<dependencies>
 15 		<dependency>
 16 			<groupId>com.taotao</groupId>
 17 			<artifactId>taotao-common</artifactId>
 18 			<version>0.0.1-SNAPSHOT</version>
 19 		</dependency>
 20 	</dependencies>
 21 </project>
 22 

Taotao-manager-pojo模块

1.1.1.1 创建工程

clip_image001[6]

clip_image003

clip_image005

clip_image007

1.1.1.2 Pom文件

不需要修改,taotao-manager-pojo模块不依赖任何jar包。

Taotao-manager-mapper模块

1.1.1.1 创建工程

clip_image002[5]

clip_image004[1]

Pom文件修改
  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 	<modelVersion>4.0.0</modelVersion>
  4 	<parent>
  5 		<groupId>com.taotao</groupId>
  6 		<artifactId>taotao-manager</artifactId>
  7 		<version>0.0.1-SNAPSHOT</version>
  8 	</parent>
  9 	<artifactId>taotao-manager-mapper</artifactId>
 10 	<!-- 依赖管理 -->
 11 	<dependencies>
 12 		<dependency>
 13 			<groupId>com.taotao</groupId>
 14 			<artifactId>taotao-manager-pojo</artifactId>
 15 			<version>0.0.1-SNAPSHOT</version>
 16 		</dependency>
 17 		<!-- Mybatis -->
 18 		<dependency>
 19 			<groupId>org.mybatis</groupId>
 20 			<artifactId>mybatis</artifactId>
 21 		</dependency>
 22 		<dependency>
 23 			<groupId>org.mybatis</groupId>
 24 			<artifactId>mybatis-spring</artifactId>
 25 		</dependency>
 26 		<dependency>
 27 			<groupId>com.github.miemiedev</groupId>
 28 			<artifactId>mybatis-paginator</artifactId>
 29 		</dependency>
 30 		<dependency>
 31 			<groupId>com.github.pagehelper</groupId>
 32 			<artifactId>pagehelper</artifactId>
 33 		</dependency>
 34 		<!-- MySql -->
 35 		<dependency>
 36 			<groupId>mysql</groupId>
 37 			<artifactId>mysql-connector-java</artifactId>
 38 		</dependency>
 39 		<!-- 连接池 -->
 40 		<dependency>
 41 			<groupId>com.alibaba</groupId>
 42 			<artifactId>druid</artifactId>
 43 		</dependency>
 44 	</dependencies>
 45 </project>
 46 

Taotao-manager-service模块

1.1.1.1 创建工程

clip_image002[7]

1.1.1.2 Pom文件
  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 	<modelVersion>4.0.0</modelVersion>
  4 	<parent>
  5 		<groupId>com.taotao</groupId>
  6 		<artifactId>taotao-manager</artifactId>
  7 		<version>0.0.1-SNAPSHOT</version>
  8 	</parent>
  9 	<artifactId>taotao-manager-service</artifactId>
 10 	<!-- 依赖管理 -->
 11 	<dependencies>
 12 		<dependency>
 13 			<groupId>com.taotao</groupId>
 14 			<artifactId>taotao-manager-mapper</artifactId>
 15 			<version>0.0.1-SNAPSHOT</version>
 16 		</dependency>
 17 		<!-- Spring -->
 18 		<dependency>
 19 			<groupId>org.springframework</groupId>
 20 			<artifactId>spring-context</artifactId>
 21 		</dependency>
 22 		<dependency>
 23 			<groupId>org.springframework</groupId>
 24 			<artifactId>spring-beans</artifactId>
 25 		</dependency>
 26 		<dependency>
 27 			<groupId>org.springframework</groupId>
 28 			<artifactId>spring-webmvc</artifactId>
 29 		</dependency>
 30 		<dependency>
 31 			<groupId>org.springframework</groupId>
 32 			<artifactId>spring-jdbc</artifactId>
 33 		</dependency>
 34 		<dependency>
 35 			<groupId>org.springframework</groupId>
 36 			<artifactId>spring-aspects</artifactId>
 37 		</dependency>
 38 	</dependencies>
 39 </project>
 40 

Taotao-manager-web模块

1.1.1.1 创建工程

clip_image002[9]

Pom文件
  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 	<modelVersion>4.0.0</modelVersion>
  4 	<parent>
  5 		<groupId>com.taotao</groupId>
  6 		<artifactId>taotao-manager</artifactId>
  7 		<version>0.0.1-SNAPSHOT</version>
  8 	</parent>
  9 	<artifactId>taotao-manager-web</artifactId>
 10 	<packaging>war</packaging>
 11 	<!-- 依赖管理 -->
 12 	<dependencies>
 13 		<dependency>
 14 			<groupId>com.taotao</groupId>
 15 			<artifactId>taotao-manager-service</artifactId>
 16 			<version>0.0.1-SNAPSHOT</version>
 17 		</dependency>
 18 		<!-- JSP相关 -->
 19 		<dependency>
 20 			<groupId>jstl</groupId>
 21 			<artifactId>jstl</artifactId>
 22 		</dependency>
 23 		<dependency>
 24 			<groupId>javax.servlet</groupId>
 25 			<artifactId>servlet-api</artifactId>
 26 			<scope>provided</scope>
 27 		</dependency>
 28 		<dependency>
 29 			<groupId>javax.servlet</groupId>
 30 			<artifactId>jsp-api</artifactId>
 31 			<scope>provided</scope>
 32 		</dependency>
 33 		<!-- 文件上传组件 -->
 34 		<dependency>
 35 			<groupId>commons-fileupload</groupId>
 36 			<artifactId>commons-fileupload</artifactId>
 37 		</dependency>
 38 	</dependencies>
 39 </project>
 40 
创建web.xml
  1 <?xml version="1.0" encoding="UTF-8"?>
  2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  4 	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  5 	id="taotao" version="2.5">
  6 	<display-name>taotao-manager</display-name>
  7 	<welcome-file-list>
  8 		<welcome-file>index.html</welcome-file>
  9 		<welcome-file>index.htm</welcome-file>
 10 		<welcome-file>index.jsp</welcome-file>
 11 		<welcome-file>default.html</welcome-file>
 12 		<welcome-file>default.htm</welcome-file>
 13 		<welcome-file>default.jsp</welcome-file>
 14 	</welcome-file-list>
 15 
 16 </web-app>
 17 

clip_image001[8]

测试maven工程

1.1 运行的工程

要运行工程,需要运行聚合工程也就是taotao-manager。

clip_image001[10]

1.1 Tomcat插件

在taotao-manager工程的pom文件中添加如下内容:

  1 <build>
  2 		<!-- 配置插件 -->
  3 		<plugins>
  4 			<plugin>
  5 				<groupId>org.apache.tomcat.maven</groupId>
  6 				<artifactId>tomcat7-maven-plugin</artifactId>
  7 				<configuration>
  8 					<port>8080</port>
  9 					<path>/</path>
 10 				</configuration>
 11 			</plugin>
 12 		</plugins>
 13 	</build>
 14 

1.2 启动工程

使用maven命令:

clean tomcat7:run

tomcat7指定使用tomcat7的插件。

注意:

1、需要把taotao-parent工程安装到本地仓库。Install

2、需要把taotao-common安装到本地仓库。

2 Svn

SVN服务器的搭建请查看该文:《Win7 x64 svn 服务器搭建

地址:https://PC-201311301552/svn/taotao-javaee16/

用户名:user

密码:user

原文地址:https://www.cnblogs.com/ios9/p/Java_TaoTao_FristDay.html