1.maven 的本地电脑配置
1.maven的下载地址 : http://maven.apache.org/download.cgi
2.解压
3.添加环境变量(系统变量中)MAVEN_HOME 地址是bin目录的上级目录
4.path(系统变量中)MAVEN_HOME 地址是bin目录的上级目录中添加%MAVEN_HOME%\bin
5.打开cmd 输入mvn - v 判断是否安装成功
6.创建一个本地仓库respository (一般在bin栏目的同级目录)
7.复制本地仓库的地址反在conf文件夹中settings.xml 例如: E:\apache-maven-3.6.3\respository
8.添加私服
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
2.idea配置maven
1.回到idea主界面–>Customize–>all Settings
2.搜索maven![在这里插入图片描述](https://img-blog.csdnimg.cn/35afc8a9c2714e89859aecdf0297786f.png)
3.maven的常见命令
1.compile :编译
2.clean :清理
3.test :测试
4.package :打包
5.install :安装
4.mysql和druid的pom.xml配置
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.2</version>
</dependency>
5.配置maven插件
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>att-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>