maven创建spark项目的pom.xml文件配置demo
作者:mliu222 时间:2023-11-02 01:14:02
pom.xml文件中添加如下配置项
创建maven项目后,在pom.xml文件中添加如下配置项:
<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>
来源:https://segmentfault.com/a/1190000012660625?utm_source=sf-similar-article
标签:maven,spark,pom.xml,文件配置
0
投稿
猜你喜欢
C#线程入门教程之单线程介绍
2022-03-15 20:37:28
C#算法函数:获取一个字符串中的最大长度的数字
2022-12-25 10:20:04
java通过方向键控制小球移动的小游戏
2023-11-10 05:25:59
springcloud注册hostname或者ip的那些事
2022-05-06 00:57:37
解决springmvc关于前台日期作为实体类对象参数类型转换错误的问题
2023-11-28 20:53:42
动态webservice调用接口并读取解析返回结果
2021-10-19 07:05:45
Android使用CircleImageView实现圆形头像的方法
2022-04-08 19:06:34
Java 中泛型 T 和 ? 的区别详解
2022-07-08 00:40:28
c#遍历System.drawing.Color下面的所有颜色以及名称以查看
2022-05-12 06:33:19
IntelliJ IDEA 关闭多余项目的操作方法
2022-02-11 04:55:13
Flutter有状态组件StatefulWidget生命周期详解
2023-09-25 23:56:50
SpringBoot项目实战之加载和读取资源文件
2023-10-07 06:00:41
Spring事务管理方法步骤解析
2021-12-15 20:09:04
Java异常处理中同时有finally和return语句的执行问题
2022-08-14 15:28:30
fastjson转换对象实体@JsonProperty不生效问题及解决
2023-10-07 00:13:51
最简单易懂的java数组排序方法整理
2023-01-03 18:56:41
winfrom 打印表格 字符串的封装实现代码 附源码下载
2021-10-27 14:30:11
java(jdk)环境变量配置(XP、win7、win8)图文教程详解
2021-11-01 15:06:48
java IO流 之 输入流 InputString()的使用
2023-08-22 07:44:31
java中面向对象的概念及知识点总结
2022-07-14 03:14:01