-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpom.xml
117 lines (104 loc) · 4.7 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>spring-stenden</groupId>
<artifactId>web</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<spring.version>5.1.9.RELEASE</spring.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<cargo-core-container-tomcat.version>1.7.0</cargo-core-container-tomcat.version>
<maven-war-plugin.version>3.2.2</maven-war-plugin.version>
<cargo-maven2-plugin.version>9.0.13</cargo-maven2-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!--Necessary for writing our initialization code-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<!--We want to serialize to and deserialize from JSON-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.7</version>
</dependency>
<!--For managing our logging-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.17.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--We need to package to WAR files to deploy a Java web application-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<!--You used to need a web.xml file, but now we can do it with just Java-->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<!--We want to deploy our web application and we're using Tomcat for that-->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>${cargo-core-container-tomcat.version}</version>
<configuration>
<!-- Container configuration -->
<deployables>
<!--The part of the project to deploy, in our case, this whole project-->
<deployable>
<groupId>spring-stenden</groupId>
<artifactId>web</artifactId>
<type>war</type>
<properties>
<!--We listen to the root path-->
<context>/</context>
</properties>
</deployable>
</deployables>
<!--The container we want to use and what we use to install it
It can do this automatically as well, but it's neat to define it-->
<container>
<containerId>tomcat9x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>${cargo-maven2-plugin.version}</version>
</artifactInstaller>
</container>
</configuration>
</plugin>
<!--We're telling Maven we want to use Java 8. Do you want to use a newer version? You can!
As long as you use Java 8 minimum for Spring 5-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>