Please enable Javascript to view the contents

Maven使用

 ·  ☕ 2 分鐘  ·  🐻 Cloud

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
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<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.MySpring-boot</groupId>
	<artifactId>com.MySpring-boot</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<build>
		<sourceDirectory>src</sourceDirectory>
		<resources>
			<resource>
				<directory>src</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<!-- <version>3.8.1</version> -->   <!-- spring-boot-starter-data-jpa 已內建依賴 -->
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<!-- <version>3.3.1</version> -->   <!-- spring-boot-starter-data-jpa 已內建依賴 -->
				<configuration>
					<warSourceDirectory>WebContent</warSourceDirectory>
				</configuration>
			</plugin>
		</plugins>
	</build>
	
	

	<!-- Maven 中央儲存庫網址 https://mvnrepository.com/ -->

	<!-- ========================================================================================== -->
	<!-- 以下為 為 Spring Boot 使用 -->

	<!-- 用途說明1: Inherit defaults from Spring Boot -->
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.4.2</version>
	</parent>

	<dependencies>

		<!-- 用途說明2: Add typical dependencies for a web application -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

		<!-- 用途說明3: Starter for using Spring Data JPA with Hibernate -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<!-- 用途說明4: for log4j.properties -->
		<!-- Spring Boot日誌系統預設是使用logback -->
		<!-- 對於習慣了log4j的開發者,Spring Boot依然有很好的支援 -->
		<!-- 不過我們在引入log4j之前,需要先排除該logback jar的依賴,再引入log4j的依賴,如下所示: -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-log4j</artifactId>
			<version>1.3.8.RELEASE</version>
		</dependency>


		<!-- ========================================================================================== -->
		<!-- 以下為 hibernate 使用 -->

		<!-- hibernate-core -->             <!-- spring-boot-starter-data-jpa(2.4.2) 已內建 Hibernate 5.4.27 依賴,但預設未下載 -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<!-- <version>5.4.27.Final</version> -->
		</dependency>

		<!-- hibernate-c3p0 連線池 -->      <!-- spring-boot 已內建依賴,但預設未下載 -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-c3p0</artifactId>
			<!-- <version>5.4.27.Final</version> -->
		</dependency>

		<!-- hibernate-proxool 連線池 -->   <!-- spring-boot 已內建依賴,但預設未下載 -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-proxool</artifactId>
			<!-- <version>5.4.27.Final</version> -->
		</dependency>


		<!-- ========================================================================================== -->
		<!-- 以下為 Web App 預備使用 -->

		<!-- Servlet 4.0.1 -->   <!-- spring-boot 已內建 Servlet 4.0.1 依賴,但預設未下載 -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<!-- <version>4.0.1</version> -->
			<scope>provided</scope>
		</dependency>

		<!-- JSTL -->            <!-- spring-boot 未內建依賴 -->
		<dependency>
			<groupId>org.apache.taglibs</groupId>
			<artifactId>taglibs-standard-impl</artifactId>
			<version>1.2.5</version>
		</dependency>

		<!-- JSTL -->            <!-- spring-boot 未內建依賴 -->
		<dependency>
			<groupId>org.apache.taglibs</groupId>
			<artifactId>taglibs-standard-spec</artifactId>
			<version>1.2.5</version>
		</dependency>

		<!-- websocket -->       <!-- spring-boot 已內建依賴,但預設未下載 -->
		<dependency>
			<groupId>javax.websocket</groupId>
			<artifactId>javax.websocket-api</artifactId>
            <!-- <version>1.1</version> -->
			<scope>provided</scope>
		</dependency>

		<!-- javax.json -->      <!-- spring-boot 未內建依賴 -->
		<dependency>
			<groupId>org.glassfish</groupId>
			<artifactId>javax.json</artifactId>
			<version>1.1.2</version>
		</dependency>

		<!-- com.sun.mail -->    <!-- spring-boot 未內建依賴 -->
		<dependency>
			<groupId>com.sun.mail</groupId>
			<artifactId>javax.mail</artifactId>
            <version>1.6.2</version>
		</dependency>

        
        <!-- ========================================================================================== -->
		<!-- 以下為 JSR 303/349/380 Bean Validation Framework 預備使用 -->
        
        <!-- javax.validation -->            <!-- spring-boot(2.4.2) 已內建依賴,但預設未下載 -->
        <dependency>
             <groupId>javax.validation</groupId>
             <artifactId>validation-api</artifactId>
             <!-- <version>2.0.1.Final</version> -->
         </dependency>
         
         <!-- org.hibernate.validator -->    <!-- spring-boot(2.4.2) 已內建依賴,但預設未下載 -->
         <dependency>
             <groupId>org.hibernate.validator</groupId>
             <artifactId>hibernate-validator</artifactId>
             <!-- <version>6.1.7.Final</version> -->
         </dependency>

		<!-- ========================================================================================== -->
	    <!-- Oracle JDBC驅動程式 ojdbc8.jar--> <!-- spring-boot(2.4.2) 已內建依賴19.8.0.0,但預設未下載 -->
	    <!-- Oracle JDBC Driver compatible with JDK8, JDK11, JDK12, JDK13, JDK14 and JDK15 -->
        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc8</artifactId>
<!--             <version>21.1.0.0</version> -->
        </dependency>
        
        <!-- MySQL8 JDBC驅動程式 ojdbc8.jar--> <!-- spring-boot(2.4.2) 已內建依賴8.022,但預設未下載 -->
	    <!-- MySQL Connector/J -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <!-- <version>8.0.23</version> -->
        </dependency>

	</dependencies>

</project>
分享

cloud
作者
Cloud
蔡逼八工程師