最终版本的pom.xml(springboot连接hive)

复制代码
  1 <?xml version="1.0" encoding="UTF-8"?>
  2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4     <modelVersion>4.0.0</modelVersion>
  5     <parent>
  6         <groupId>org.springframework.boot</groupId>
  7         <artifactId>spring-boot-starter-parent</artifactId>
  8         <version>3.3.3</version>
  9         <relativePath/> <!-- lookup parent from repository -->
 10     </parent>
 11     <groupId>com.lian</groupId>
 12     <artifactId>hiveDemo</artifactId>
 13     <version>0.0.1-SNAPSHOT</version>
 14     <name>hiveDemo</name>
 15     <description>hiveDemo</description>
 16     <url/>
 17     <licenses>
 18         <license/>
 19     </licenses>
 20     <developers>
 21         <developer/>
 22     </developers>
 23     <scm>
 24         <connection/>
 25         <developerConnection/>
 26         <tag/>
 27         <url/>
 28     </scm>
 29     <properties>
 30         <java.version>17</java.version>
 31     </properties>
 32     <dependencies>
 33         <dependency>
 34             <groupId>org.springframework.boot</groupId>
 35             <artifactId>spring-boot-starter</artifactId>
 36         </dependency>
 37 
 38         <dependency>
 39             <groupId>org.springframework.boot</groupId>
 40             <artifactId>spring-boot-starter-test</artifactId>
 41             <scope>test</scope>
 42         </dependency>
 43 
 44         <dependency>
 45             <groupId>org.springframework.boot</groupId>
 46             <artifactId>spring-boot-starter-web</artifactId>
 47         </dependency>
 48 
 49         <!-- Hive JDBC 驱动 -->
 50         <dependency>
 51             <groupId>org.apache.hive</groupId>
 52             <artifactId>hive-jdbc</artifactId>
 53             <version>3.1.2</version>
 54 <!--            <exclusions>-->
 55 <!--                <exclusion>-->
 56 <!--                    <groupId>org.slf4j</groupId>-->
 57 <!--                    <artifactId>slf4j-reload4j</artifactId>-->
 58 <!--                </exclusion>-->
 59 <!--                <exclusion>-->
 60 <!--                    <groupId>org.eclipse.jetty</groupId>-->
 61 <!--                    <artifactId>jetty-all</artifactId>-->
 62 <!--                </exclusion>-->
 63 <!--                <exclusion>-->
 64 <!--                    <groupId>org.eclipse.jetty</groupId>-->
 65 <!--                    <artifactId>jetty-server</artifactId>-->
 66 <!--                </exclusion>-->
 67 <!--            </exclusions>-->
 68 
 69             <exclusions>
 70                 <exclusion>
 71                     <groupId>org.apache.orc</groupId>
 72                     <artifactId>*</artifactId>
 73                 </exclusion>
 74                 <exclusion>
 75                     <groupId>javax.servlet.jsp</groupId>
 76                     <artifactId>javax.servlet.jsp-api</artifactId>
 77                 </exclusion>
 78                 <exclusion>
 79                     <groupId>org.eclipse.jetty</groupId>
 80                     <artifactId>*</artifactId>
 81                 </exclusion>
 82                 <exclusion>
 83                     <groupId>io.netty</groupId>
 84                     <artifactId>*</artifactId>
 85                 </exclusion>
 86                 <exclusion>
 87                     <groupId>org.apache.hbase</groupId>
 88                     <artifactId>hbase-hadoop-compat</artifactId>
 89                 </exclusion>
 90                 <exclusion>
 91                     <groupId>org.apache.hbase</groupId>
 92                     <artifactId>*</artifactId>
 93                 </exclusion>
 94             </exclusions>
 95         </dependency>
 96 
 97         <!-- MySQL Connector (如果需要) -->
 98         <dependency>
 99             <groupId>com.mysql</groupId>
100             <artifactId>mysql-connector-j</artifactId>
101             <scope>runtime</scope>
102         </dependency>
103 
104 <!--        <dependency>-->
105 <!--            <groupId>com.baomidou</groupId>-->
106 <!--            <artifactId>mybatis-plus-boot-starter</artifactId>-->
107 <!--            <version>3.4.1</version>-->
108 <!--        </dependency>-->
109 
110         <!-- SLF4J 日志 -->
111         <dependency>
112             <groupId>org.slf4j</groupId>
113             <artifactId>slf4j-api</artifactId>
114             <version>2.0.16</version>
115         </dependency>
116 
117 
118 
119         <!-- Hadoop Common -->
120         <dependency>
121             <groupId>org.apache.hadoop</groupId>
122             <artifactId>hadoop-common</artifactId>
123             <version>3.3.5</version>
124             <exclusions>
125                 <exclusion>
126                     <groupId>org.slf4j</groupId>
127                     <artifactId>slf4j-reload4j</artifactId>
128                 </exclusion>
129                 <exclusion>
130                     <groupId>org.slf4j</groupId>
131                     <artifactId>slf4j-reload4j</artifactId>
132                 </exclusion>
133                 <exclusion>
134                     <groupId>org.eclipse.jetty</groupId>
135                     <artifactId>jetty-all</artifactId>
136                 </exclusion>
137                 <exclusion>
138                     <groupId>org.eclipse.jetty</groupId>
139                     <artifactId>jetty-server</artifactId>
140                 </exclusion>
141             </exclusions>
142         </dependency>
143 
144         <!-- Hadoop HDFS (如果需要与 HDFS 交互) -->
145         <dependency>
146             <groupId>org.apache.hadoop</groupId>
147             <artifactId>hadoop-hdfs</artifactId>
148             <version>3.3.5</version>
149             <exclusions>
150                 <exclusion>
151                     <groupId>org.slf4j</groupId>
152                     <artifactId>slf4j-reload4j</artifactId>
153                 </exclusion>
154                 <exclusion>
155                     <groupId>org.slf4j</groupId>
156                     <artifactId>slf4j-reload4j</artifactId>
157                 </exclusion>
158                 <exclusion>
159                     <groupId>org.eclipse.jetty</groupId>
160                     <artifactId>jetty-all</artifactId>
161                 </exclusion>
162                 <exclusion>
163                     <groupId>org.eclipse.jetty</groupId>
164                     <artifactId>jetty-server</artifactId>
165                 </exclusion>
166             </exclusions>
167         </dependency>
168 
169 
170 
171         <dependency>
172             <groupId>org.mybatis.spring.boot</groupId>
173             <artifactId>mybatis-spring-boot-starter</artifactId>
174             <version>3.0.3</version>
175         </dependency>
176 
177 
178 
179 
180 
181 
182 
183 
184         <!--        <dependency>-->
185 <!--            <groupId>org.glassfish.web</groupId>-->
186 <!--            <artifactId>jakarta.servlet.jsp.jstl</artifactId>-->
187 <!--            <version>3.1.0</version>-->
188 <!--        </dependency>-->
189 
190 
191 
192 
193     </dependencies>
194 
195     <build>
196         <plugins>
197             <plugin>
198                 <groupId>org.springframework.boot</groupId>
199                 <artifactId>spring-boot-maven-plugin</artifactId>
200             </plugin>
201 
202             <plugin>
203                 <groupId>org.apache.maven.plugins</groupId>
204                 <artifactId>maven-compiler-plugin</artifactId>
205                 <version>3.8.1</version>
206                 <configuration>
207                     <source>17</source>
208                     <target>17</target>
209                 </configuration>
210             </plugin>
211 
212         </plugins>
213     </build>
214 
215 </project>
复制代码

要注意springboot的版本与mybatis版本的适配

要注意在hive驱动中排除jetty等依赖与tomcat的冲突,还要排除jsp等之间与项目之间的冲突

要避免logback与slf4j之间的冲突(排除其他驱动所带的slg4j日志,然后自己手动引入slg4f版本)

 

posted @   连师傅只会helloword  阅读(24)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
历史上的今天:
2023-09-18 9.18总结
点击右上角即可分享
微信分享提示