企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
**Maven** **我为什么要学习这个技术?** 1.在Javaweb开发中,需要使用大量的jar包,我们手动去导入; 2.如何能够让一个东西自动帮我导入和配置这个jar包。 由此,Maven诞生了! **1.1 Maven** **项目架构管理工具** 我们目前用来就是方便导入jar包的! Maven的核心思想:**约定大于配置** ** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps1.png)有约束,不要去违反。 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** **阿里云镜像** ** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps2.png)镜像: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项目 ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps3.png)3.等待项目初始化完毕 ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps4.png)4.观察maven仓库中多了什么东西? 5.IDEA中的Maven设置 注意:IDEA项目创建成功后,看一眼Maven的配置 ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps5.png)6.到这里,Maven在IDEA中的配置和使用就OK了! **1.7****、创建一个普通的****Maven****项目** ** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps6.png)这个只有在Web应用下才会有! **1.8** **标记文件夹功能** ** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps7.png) ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps8.png) **1.9** **在****IDEA****中配置****Tomcat** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps9.png) ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps10.png)解决警告问题 必须要的配置:**为什么会有这个问题:我们访问一个网站,需要指定一个文件夹名字;** ** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps11.png) **1.10** **pom** **文件** pom.xml是Maven的核心配置文件 ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps12.png)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;">&nbsp;<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;">&lt;!--<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;">--&gt;<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;">&lt;build&gt;<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;">&lt;finalName&gt;<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;">&lt;/finalName&gt;<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0); font-size:9.0000pt;"> ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps13.png)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;">&nbsp;<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;">&lt;/plugin&gt;<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;">&lt;plugin&gt;<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;">&lt;artifactId&gt;<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;">&lt;/artifactId&gt;<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;">&lt;version&gt;<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;">&lt;/version&gt;<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;">&lt;/plugin&gt;<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;">&lt;plugin&gt;<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;">&lt;artifactId&gt;<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;">&lt;/artifactId&gt;<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;">&nbsp;<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;">&lt;version&gt;<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;">&lt;/version&gt;<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;">&lt;/plugin&gt;<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;">&lt;plugin&gt;<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;">&nbsp;<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;">&lt;artifactId&gt;<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;">&lt;/artifactId&gt;<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;">&nbsp;<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;">&lt;version&gt;<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;">&lt;/version&gt;<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;">&lt;/plugin&gt;<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;">&lt;/plugins&gt;<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;">&lt;/pluginManagement&gt;<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0); font-size:9.0000pt;"> 74 75 76 ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps14.png)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;">&nbsp;<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;">&nbsp;<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;">&lt;/resources&gt;<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;">&lt;/build&gt;<span style="font-family:'Lucida Console';mso-hansi-font-family:Calibri;color:rgb(0,0,0); font-size:9.0000pt;"> **1.12 IDEA****操作** ** ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps15.png) **1.13** **解决遇到的问题** 1.Maven3.6.2 解决方法:降级为3.6.1 2.Tomcat闪退 3.IDEA中每次都要重复配置Maven在IDEA中的全局默认配置中去配置 ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps16.png)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/) ![](file:///C:\Users\mac\AppData\Local\Temp\ksohtml7968\wps17.png) ************