**Maven**
**我為什么要學習這個技術?**
1.在Javaweb開發中,需要使用大量的jar包,我們手動去導入;
2.如何能夠讓一個東西自動幫我導入和配置這個jar包。
由此,Maven誕生了!
**1.1 Maven** **項目架構管理工具**
我們目前用來就是方便導入jar包的!
Maven的核心思想:**約定大于配置**
**
有約束,不要去違反。
Maven會規定好你該如何去編寫我們的Java代碼,必須要按照這個規范來;
**1.2** **下載安裝****Maven**
官網;[https://maven.apache.org/](https://maven.apache.org/)
下載完成后,解壓即可;
友情建議:電腦上的所有環境都放在一個文件夾下,方便管理;
**1.3** **配置環境變量**
在我們的系統環境變量中
配置如下配置:
M2\_HOMEmaven目錄下的bin目錄MAVEN\_HOMEmaven的目錄 在系統的path中配置%MAVEN\_HOME%\\bin
測試Maven是否安裝成功,保證必須配置完畢!
**1.4** **阿里云鏡像**
**
鏡像:mirrors
作用:加速我們的下載 國內建議使用阿里云的鏡像
1
2nexus-aliyun
3\*,!jeecg,!jeecg-snapshots
4Nexus aliyun
5http://maven.aliyun.com/nexus/content/groups/public
6
**1.5** **本地倉庫**
在本地的倉庫,遠程倉庫;
**建立一個本地倉庫:**localRepository
1D:\\Environment\\apache-maven-3.6.2\\maven-
repo
**1.6****、在****IDEA****中使用****Maven**
1.啟動IDEA
2.創建一個MavenWeb項目
3.等待項目初始化完畢
4.觀察maven倉庫中多了什么東西?
5.IDEA中的Maven設置
注意:IDEA項目創建成功后,看一眼Maven的配置
6.到這里,Maven在IDEA中的配置和使用就OK了!
**1.7****、創建一個普通的****Maven****項目**
**
這個只有在Web應用下才會有!
**1.8** **標記文件夾功能**
**


**1.9** **在****IDEA****中配置****Tomcat**

解決警告問題
必須要的配置:**為什么會有這個問題:我們訪問一個網站,需要指定一個文件夾名字;**
**

**1.10** **pom** **文件**
pom.xml是Maven的核心配置文件
1
2
3
4<project xmlns\="http://maven.apache.org/POM/4.0.0"
xmlns:xsi\="http://www.w3.org/2001/XMLSchema-instance"
5xsi:schemaLocation\="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"\>
64.0.0
7
8
9com.kuang
10javaweb-01-maven
111.0-SNAPSHOT
12<!--Package:項目的打包方式
13jar:java應用
14war:JavaWeb應用
15\-->
16war
17
18
19
20
21
22UTF-8
23
241.8
251.8
26
27
28
29
30
31
32junit
33junit
344.11
35
36
37
<table class="MsoNormalTable" border="0" cellspacing="0" style="border-collapse:collapse;margin-left:5.4000pt;border:none;
mso-padding-alt:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;"><td width="64" valign="top" style="width:32.1500pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.6000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">38<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">39<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">40<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><td width="2" valign="top" style="width:1.0000pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
mso-line-height-alt:0pt;"><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"> <td width="441" valign="top" style="width:220.8500pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(170,85,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><!--<span style="mso-spacerun:'yes';font-family:新宋體;mso-fareast-font-family:'Times New Roman';
color:rgb(170,85,0);letter-spacing:-0.2000pt;font-size:9.0000pt;">項目構建用的東西<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(170,85,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;">--><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><build><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:10.6000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><finalName><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">javaweb-01-maven<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></finalName><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;">
41<!-- lock down plugins versions to avoid using Maven
defaults (may be moved to parent pom) -->
42
43
44maven-clean-plugin
453.1.0
46
47<!-- see http://maven.apache.org/ref/current/maven-core/default-
bindings.html#Plugin\_bindings\_for\_war\_packaging -->
48
49maven-resources-plugin
503.0.2
51
52
53maven-compiler-plugin
543.8.0
55
56
57maven-surefire-plugin
582.22.1
<table class="MsoNormalTable" border="0" cellspacing="0" style="border-collapse:collapse;margin-left:5.4000pt;border:none;
mso-padding-alt:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;"><td width="85" valign="top" style="width:42.7500pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">59<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">60<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">61<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">62<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">63<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">64<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">65<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">66<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">67<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">68<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">69<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">70<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">71<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">72<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">73<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><td width="2" valign="top" style="width:1.0000pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
mso-line-height-alt:0pt;"><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"> <td width="547" valign="top" style="width:273.7500pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:31.7500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><artifactId><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">maven-war-plugin<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></artifactId><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:31.7500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><version><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">3.2.2<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></version><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:31.7500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><artifactId><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">maven-install-plugin<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></artifactId><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';mso-hansi-font-family:Calibri;
mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);letter-spacing:5.1500pt;
font-size:9.0000pt;"> <span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><version><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">2.5.2<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></version><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';mso-hansi-font-family:Calibri;
mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);letter-spacing:5.1500pt;
font-size:9.0000pt;"> <span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><artifactId><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">maven-deploy-plugin<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></artifactId><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';mso-hansi-font-family:Calibri;
mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);letter-spacing:5.1500pt;
font-size:9.0000pt;"> <span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"><version><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(51,51,51);
letter-spacing:-0.1500pt;font-size:9.0000pt;">2.8.2<span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></version><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:13.5000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></plugin><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:10.6000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></plugins><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></pluginManagement><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;">
74
75
76
maven由于他的約定大于配置,我們之后可以能遇到我們寫的配置文件,無法被導出或者生效的問題, 解決方案:
1
2
3
4
5src/main/resources
6
7\*\*/\*.properties
8\*\*/\*.xml
9
10true
11
12
13src/main/java
14
15\*\*/\*.properties
16\*\*/\*.xml
17
18true
19
<table class="MsoNormalTable" border="0" cellspacing="0" style="border-collapse:collapse;margin-left:5.4000pt;border:none;
mso-padding-alt:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;"><td width="22" valign="top" style="width:11.2000pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
mso-line-height-alt:0pt;"><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"> <td width="43" valign="top" style="width:21.6000pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">20<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(153,153,153);
letter-spacing:-0.1500pt;font-size:9.0000pt;">21<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><td width="2" valign="top" style="width:1.0000pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
mso-line-height-alt:0pt;"><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"> <td width="177" valign="top" style="width:88.6000pt;padding:0.0000pt 0.0000pt 0.0000pt 0.0000pt ;border-left:none;
border-right:none;border-top:none;border-bottom:none;"><p class="MsoNormal" style="margin-top:0.0000pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:21.1500pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></resources><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;"><p class="MsoNormal" style="margin-top:4.7500pt;margin-right:0.0000pt;margin-bottom:0.0000pt;
margin-left:0.0000pt;text-indent:0.0000pt;text-align:left;
line-height:8.8000pt;mso-line-height-rule:exactly;"><span style="mso-spacerun:'yes';font-family:'Lucida Console';mso-fareast-font-family:'Times New Roman';
mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';color:rgb(17,119,0);
letter-spacing:-0.1500pt;font-size:9.0000pt;"></build><span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0);
font-size:9.0000pt;">
**1.12 IDEA****操作**
**

**1.13** **解決遇到的問題**
1.Maven3.6.2
解決方法:降級為3.6.1
2.Tomcat閃退
3.IDEA中每次都要重復配置Maven在IDEA中的全局默認配置中去配置
4.Maven項目中Tomcat無法配置
5.maven默認web項目中的web.xml版本問題
6.替換為webapp4.0版本和tomcat一致
1
2<web-app xmlns\="http://xmlns.jcp.org/xml/ns/javaee"
3xmlns:xsi\="http://www.w3.org/2001/XMLSchema-instance"
4xsi:schemaLocation\="http://xmlns.jcp.org/xml/ns/javaee
5http://xmlns.jcp.org/xml/ns/javaee/web-
app\_4\_0.xsd"
6version\="4.0"
7metadata-complete\="true"\>
8
9
10
11
7.Maven倉庫的使用
地址:[https://mvnrepository.com/](https://mvnrepository.com/)

************
- Java Web項目開發學習手冊
- 一、B/S開發環境搭建
- 1.1 tomcat服務器目錄結構及作用
- 1.2 在IDE開發工具上配置tomcat服務器
- 1.3 簡單web項目在tomcat服務器上運行的方法
- 1.4 開發工具設置
- 1.5 總結
- 二、Servlet技術應用
- 2.1 HttpServlet中的主要方法及應用
- 2.1.1 基于Eclipse完成一個JavaWeb項目
- 2.2 HttpRequest,HttpResponse的應用
- 2.2.1客戶端請求
- 2.2.2服務器響應
- 2.2.3Servlet HTTP 狀態碼
- 2.2.4圖片驗證碼類
- 2.2.5注冊模擬實現(帶驗證碼)
- 2.3 ServletConfig對象和ServletContext對象的概念
- 2.4 總結
- 三、JSP技術應用
- 3.1 JSP基本語法
- 3.2 JSP標簽和指令
- 3.3 JSP中的隱式對象
- 3.4 常用應用操作
- 3.4.1 JSP客戶端請求
- 3.4.2 JSP服務器響應
- 3.4.3 HTTP狀態碼
- 3.4.4 表單處理
- 3.4.5 過濾器
- 3.4.6 Cookie處理
- 3.4.7 Session處理
- 3.4.8 文件上傳
- 3.4.9 日期處理
- 3.4.10 頁面重定向
- 3.4.11 點擊量統計
- 3.4.12 自動刷新
- 3.4.13 發送郵件
- 3.5 JSP高級應用
- 3.5.1 JSP標準標簽庫(JSTL)
- 3.5.2 JSP連接數據庫
- 3.5.3 JSP XML數據處理
- 3.5.4 JSP JavaBean
- 3.5.5 自定義標簽
- 3.5.6 表達式語言
- 3.5.7 異常處理
- 3.5.8 調試
- 3.5.9 JSP國際化
- 3.6 實踐代碼
- 3.6.1 實踐代碼
- 3.6.2 項目實戰
- 3.7 總結
- 四、MVC思想的理解和搭建MVC
- 4.1 MVC設計模式的思想
- 4.2 MVC設計模式的實現步驟
- 4.3 項目實踐
- 4.4 總結
- 五、EL表達式和JSTL技術
- 5.1 EL表達式及其應用
- 5.2 常用的JSTL標簽的應用
- 5.3 項目實踐
- 5.4 總結
- 六、Cookie和Session
- 6.1 cookie對象的概念和應用
- 6.2 session對象的概念和應用
- 6.3 項目實踐
- 6.4 總結
- 七、過濾器技術應用
- 7.1 Filter的概念及應用
- 7.2 Filter、FilterChain、FilterConfig 介紹
- 7.3 用戶登錄過濾案例
- 7.4 項目實戰
- 7.5總結
- 八、異步請求技術
- 8.1 JSON數據格式
- 8.2 使用AJAX實現異步請求
- 8.3 用戶名校驗案例
- 8.4小結
- 綜合項目技術實訓
- 1.BS項目開發項目實戰
- 2.項目需求分析和系統設計
- 2.1需求分析
- 2.2類型模型設計
- 2.3原型設計
- 3.項目數據庫分析和系統設計
- 4.BS項目編程實現
- 4.1搭建框架和命名規約
- 4.2實現步驟
- 4.2.1創建實體類
- 4.2.2創建過濾器類
- 4.2.3創建工具類
- 4.2.4創建DAO接口及其實現類
- 4.2.5創建Service接口及其實現類
- 4.2.6創建測試類
- 4.2.7創建控制器類
- 5.企業開發流程規范
- 6.總結
- 九、練習題及答案
- 企業開發常用技術
- 1.Maven技術
- Java命名規范解讀
- 參考資料
- 開發中常用的應用服務器和Web服務器