-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
172 lines (147 loc) · 7.22 KB
/
pom.xml
File metadata and controls
172 lines (147 loc) · 7.22 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?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>com.jasonfitch.test</groupId>
<artifactId>SpringBootTest</artifactId>
<packaging>jar</packaging>
<!-- <packaging>war</packaging> -->
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!--parent 工程的版本不能属性化-->
<!-- <version>1.5.18.RELEASE</version>-->
<version>2.0.5.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--
打开Spring Boot最终产出的fat jar包,其MANIFEST.MF文件表明项目的启动入口为org.springframework.boot.loader.JarLauncher,
该类在spring-boot-loader模块下,运行时由Spring Boot所提供,因此可以通过maven引入provided类型的依赖从而查看到源码。
-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-loader</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--
springboot 1.x 简单的 spring session 实现,只用内存型可以直接引入他,无需 redis 等第三方存储
springboot 2.x 中该依赖更名,新名称对应于 spring-session-core ,
由spring-session-data-redis间接引入,必须要一个第三方储存
-->
<!--<dependency>-->
<!--<groupId>org.springframework.session</groupId>-->
<!--<artifactId>spring-session</artifactId>-->
<!--</dependency>-->
<!-- Spring session redis support-->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/io.lettuce/lettuce-core
早起版本 springboot 默认的策略会使用lettuce作为redis client,如若使用jedis需要一些特殊的修改。
springboot 1.x/2.x 不知道从哪个版本开始 springboot 使用了 jedis 作为默认的 redis client 了。
-->
<!--<dependency>-->
<!--<groupId>io.lettuce</groupId>-->
<!--<artifactId>lettuce-core</artifactId>-->
<!--</dependency>-->
<!-- 导入 redis 的相关依赖,
springboot 1.x 自动引入,因为通过 spring-session-data-redis 中已经间接的引入了相关的依赖了
springboot 2.x 需要主动导入 spring-session-data-redis 中移除了对其的相关依赖了
-->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<!--用于编译jsp
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Fri Feb 15 13:48:52 CST 2019
There was an unexpected error (type=Not Found, status=404).
No message available
-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<!--<scope>provided</scope>-->
</dependency>
<!--jsp页面使用jstl标签
The absolute uri: [http://java.sun.com/jsp/jstl/core]
cannot be resolved in either web.xml or the jar files deployed with this application
-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.156</version>
</dependency>
<!-- Test Scope -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- 指定最终编译出来的jar包名字 -->
<finalName>${project.artifactId}</finalName>
<plugins>
<!--打包成war使用的插件,同时需使用 <packaging>war</packaging> 指定打包格式为 war,否则没用-->
<!--如果仅仅是打包为spring boot的可执行jar,无需指定打包格式,默认就是jar-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
</plugin>
<!--spring boot的插件,将mvn打包之后的再打包为可启动的jar或者是war-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--
下面的编译错误是因为没有显示的指定 mainClass 属性使用哪个 class ,虽然 spring boot 插件默认会去找 main 方法所在的 class ,但是这里存在多个 main class ,他不清楚该使用哪一个
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) on project SpringBootTest:
Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.5.RELEASE:repackage failed:
Unable to find a single main class from the following candidates
[hello.Application, sample.mybatis.war.SampleWebApplication, sample.mybatis.xml.SampleXmlApplication] -> [Help 1]
-->
<configuration>
<mainClass>hello.Application</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-project-lib</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>