1.在setting(apache-maven-3.5.3\conf中)文件中配置本地仓库:<localRepository>F:\03_mavenRepository\m2</localRepository>,路径名随意
2.在setting文件中配置阿里云镜像:选一个好用的
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
3.配置环境变量:MAVEN_HOME:安装路径,Path:;%MAVEN_HOME%\bin;
4.Maven配置:
Windows->preference->Maven->Installations:E:\04_学习软件\maven\apache-maven-3.5.3(安装路径)
Windows->preference->Maven->User Setting:E:\04_学习软件\maven\apache-maven-3.5.3\conf\settings.xml(使用自己项目的setting配置文件
5.配置Tomcat服务器(如果index.jsp不报错就不需要配置):右击项目->properties->Java Bulid Path->Libraries->Add Library->Server Runtime->选择Tomcat
6.安装编译插件,放在build里面
<plugins>
<!-- 设置编译版本为1.7 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>