properties属性
1
2
3
4
5
6
7
8
|
<properties> <!--使用utf- 8 编码--> <project.build.sourceEncoding>UTF- 8 </project.build.sourceEncoding> <!--web--> <spring.version> 4.3 . 14 .RELEASE</spring.version> <!--数据库相关--> <mysql.version> 6.0 . 6 </mysql.version> </properties> |
dependencyManagement
1
2
3
4
5
6
7
8
9
10
11
|
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-framework-bom</artifactId> <version>${spring.version}</version> <type>pom</type> <scope> import </scope> </dependency> </dependencies> </dependencyManagement> |
dependencies
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
|
<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version> 4.12 </version> <scope>test</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version> 1.2 . 17 </version> </dependency> <!--web--> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version> 2.5 </version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>javax.servlet.jsp-api</artifactId> <version> 2.3 . 1 </version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>javax.servlet.jsp.jstl-api</artifactId> <version> 1.2 . 1 </version> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> <version> 2.0 </version> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version> 1.0 </version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version> 1.2 </version> </dependency> <dependency> <groupId>javax.transaction</groupId> <artifactId>javax.transaction-api</artifactId> <version> 1.2 </version> </dependency> <!--Spring--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> </dependency> <!--spring-oxm依赖--> <dependency> <groupId>org.codehaus.castor</groupId> <artifactId>castor-xml</artifactId> <version> 1.4 . 1 </version> </dependency> <!--spring-json依赖--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version> 2.9 . 4 </version> </dependency> <!--<dependency>--> <!--<groupId>com.fasterxml.jackson.dataformat</groupId>--> <!--<artifactId>jackson-dataformat-xml</artifactId>--> <!--<version> 2.9 . 4 </version>--> <!--</dependency>--> <!--spring-aop依赖--> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version> 1.8 . 13 </version> </dependency> <!--上传文件--> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version> 1.3 . 3 </version> </dependency> <!--mysql--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> <!--druid--> <!-- https: //mvnrepository.com/artifact/com.alibaba/druid --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version> 1.1 . 9 </version> </dependency> <!--Mybatis--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version> 3.4 . 6 </version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version> 1.3 . 2 </version> </dependency> <!-- Mybatis Generator --> <dependency> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-core</artifactId> <version> 1.3 . 6 </version> <scope>compile</scope> <optional> true </optional> </dependency> <!-- 工具集 --> <!--操作json--> <!-- https: //mvnrepository.com/artifact/com.alibaba/fastjson --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version> 1.2 . 47 </version> </dependency> </dependencies> |
web.xml
1
2
3
4
5
6
7
8
9
|
<?xml version= "1.0" encoding= "UTF-8" ?> <web-app xmlns= "http://java.sun.com/xml/ns/javaee" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http: //java.sun.com/xml/ns/javaee http: //java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version= "3.0" > <display-name>Archetype Created Web Application</display-name> </web-app> |
补充:
下面看下Spring boot starter pom的依赖关系说明
spring boot starter 旨在为具有依赖关系的一组jar包提供统一的条目框架
它们通常应该从项目描述符(pom.xml)继承,以便获得配置版本的所有父依赖关系。 在开发者一方没有更多的负担:
Starter POM是一组方便的依赖关系描述符,可以包含在应用程序中。 你可以得到一个一站式的所有Spring和相关技术,你需要,而不必通过示例代码和复制粘贴负载的依赖关系描述符。 例如,如果您想要开始使用Spring和JPA进行数据库访问,只需在项目中包含spring-boot-starter-data-jpa依赖项,您就可以开始使用了。
这些POM可以用于合成被用于某种项目的依赖,例如, 对于一个简单的Spring MVC项目,将包括以下工件(分别从spring-boot-starter,spring-boot-starter-web,spring-boot-starter-security读取):
starter本身在你的应用程序中实际上是空的。 有些包括META-INF / spring.provides文件,IDE可以使用它来提供POM更新的上下文帮助。 在POM包装上选择“空”jar的主要原因是它们更容易使用(你不需要记住添加 pom </ type>)。
总结
以上所述是小编给大家介绍的Spring 项目常用pom文件的依赖,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!
原文链接:https://blog.csdn.net/lamp113/article/details/79751731