1. mall-parent Maven父工程
所有工程都继承父工程。父工程只编写pom.xml
1.1. pom.xml
pom.xml主要的配置如下,但是没有列出完整的依赖1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45<!-- 声明子项目公用的配置属性 -->
<properties>
<junit.version>4.12</junit.version>
<spring.version>5.1.5.RELEASE</spring.version>
<mysql.version>5.1.32</mysql.version>
</properties>
<!-- 声明并引入子项目共有的依赖 -->
<dependencies>
<!-- junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- 仅声明子项目共有的依赖,如果子项目需要此依赖,那么子项目需要声明 -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<!-- 声明构建信息 -->
<build>
<!-- 声明并引入子项目共有的插件(插件就是附着到Maven各个声明周期的具体实现) -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<!-- 统一按照JDK1.8编译 -->
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>