-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.xml
103 lines (86 loc) · 3.69 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!--描述这个POM文件是遵从哪个版本的项目描述符-->
<!--指定了当前POM模型的版本-->
<!--对于Maven2及Maven 3来说,固定为4.0.0-->
<modelVersion>4.0.0</modelVersion>
<!--一个Maven工程就是由groupId,artifactId和version作为唯一标识-->
<!--组织的唯一标识,类似于Java的包名-->
<groupId>com.lizhanxu.mypractice</groupId>
<!--项目的唯一标识,类似于Java的类名-->
<artifactId>learn-backend</artifactId>
<!--项目版本-->
<version>1.0.0</version>
<name>learn-backend</name>
<!--父模块必须以pom打包类型,同时以<modules>给出所有的子模块-->
<!--项目的打包方式,默认是jar-->
<packaging>pom</packaging>
<modules>
<module>Spring</module>
<module>JavaBase</module>
<module>Netty</module>
<module>Mybatis</module>
<module>SpringMVC</module>
<module>Servlet</module>
<module>SpringMVC_2</module>
</modules>
<!--定义变量的值-->
<!--Maven中占位符用${}-->
<properties>
<java.version>1.8</java.version>
<!--两种方式,参考网址:https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
方式一,通过默认属性名配置插件参数-->
<!--<maven.compiler.source>1.8</maven.compiler.source>-->
<!--<maven.compiler.target>1.8</maven.compiler.target>-->
<springframework.version>5.2.0.RELEASE</springframework.version>
</properties>
<dependencyManagement>
<dependencies>
<!--Spring框架-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springframework.version}</version>
</dependency>
<!--Spring MVC-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<!--Spring提供的集成测试-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
<version>${springframework.version}</version>
</dependency>
<!--单元测试框架-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<!--方式二,直接配置插件-->
<!--maven编译插件,若不声明,则maven采用默认的相关配置-->
<!-- 指定maven编译的jdk版本,如果不指定,maven3默认用jdk 1.5 maven2默认用jdk1.3 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>