介绍
概念
下载
配置环境
与JDK一样,配置一个MAVEN_HOME
,在PATH中配置%MAVEN_HOME%\bin
本地仓库
<!-- 本地仓库地址 -->
<localRepository>D:\Ab_Work\repository</localRepository>
<!-- 阿里云镜像 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- JDK版本 -->
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
IDEA快速搭建模板
Java工程
Web工程
pom报红问题
指代与项目相同的版本
指定打包时的包名
<build>
<finalName>包名</finalName>
</build>
版本过高问题
历史版本下载地址
加入本地Jar包
<!-- 本地Jar,放在resources/lib中 -->
<dependency>
<groupId>com.arcsoft.face</groupId> // 可随便填写
<artifactId>arcsoft-sdk-face</artifactId> // 可随便填写
<version>2.2.0.1</version> // 可随便填写
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/readersdk_android_v2.0.9.jar</systemPath>
</dependency>
<!-- 解决打包不存在问题 -->
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
子项目相互依赖打包找不到依赖问题/必须主启动类问题
在被依赖的项目pom中配置
<build>
<plugins>
<!-- 打包插件 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 解决相互依赖打包找不到问题 -->
<classifier>exec</classifier>
<!-- 解决打包必须要主启动类问题 -->
<skip>true</skip>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
注意:新搭建的项目,需要执行一次mvn install