maven創(chuàng)建spark項(xiàng)目的pom.xml文件配置demo
pom.xml文件中添加如下配置項(xiàng)
創(chuàng)建maven項(xiàng)目后,在pom.xml文件中添加如下配置項(xiàng):
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<scala.version>2.10.5</scala.version>
<spark.version>1.6.2</spark.version>
<hadoop.version>2.6.4</hadoop.version>
<encoding>UTF-8</encoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoop.version}</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- 編譯scala的插件 -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<!-- 編譯java的插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 打包插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>以上就是maven創(chuàng)建spark項(xiàng)目的pom.xml文件配置demo的詳細(xì)內(nèi)容,更多關(guān)于maven創(chuàng)建spark的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
IDEA快速搭建spring?boot項(xiàng)目教程(Spring?initializr)
這篇文章主要介紹了IDEA快速搭建spring?boot項(xiàng)目教程(Spring?initializr),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-01-01
解決JSONObject.toJSONString()輸出null的問(wèn)題
這篇文章主要介紹了解決JSONObject.toJSONString()輸出null的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-02-02
spring mvc DispatcherServlet之前端控制器架構(gòu)詳解
這篇文章主要為大家詳細(xì)介紹了spring mvc DispatcherServlet之前端控制器架構(gòu),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-04-04
Spring?Boot?lombok在高版本idea中注解不生效的解決辦法
這篇文章主要介紹了Spring?Boot?lombok在高版本idea中注解不生效的解決辦法,文中介紹了三種解決方案,分別是使用ptg插件生成方法、添加Lombok依賴或指定1.18.30版本并清除構(gòu)建配置,需要的朋友可以參考下2025-05-05
IntelliJ IDEA 關(guān)閉多余項(xiàng)目的操作方法
這篇文章主要介紹了IntelliJ IDEA 關(guān)閉多余項(xiàng)目的操作方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-04-04
SpringBoot集成Kafka開(kāi)發(fā)超詳細(xì)過(guò)程解析
本文詳解SpringBoot集成Kafka開(kāi)發(fā),涵蓋項(xiàng)目搭建、配置文件設(shè)置、生產(chǎn)消費(fèi)者實(shí)現(xiàn)、消息發(fā)送策略、偏移量管理及核心概念如副本、存儲(chǔ),適用于消息處理與系統(tǒng)間通信場(chǎng)景,感興趣的朋友跟隨小編一起看看吧2025-08-08

