当前位置: 首页 > news >正文

Spark的开发环境配置

1. 介绍

这里主要记录一下,我们常用的maven配置,方便后期开发配置环境,避免每次都从零开始配置工程。

2. 工程目录

在这里插入图片描述

3. pom的配置

<?xml version="1.0" encoding="UTF-8"?>
<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>org.example</groupId><artifactId>sparkdemo01</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><scala.version>2.12.7</scala.version><scala.simple.version>2.12</scala.simple.version><spark.version>3.2.2</spark.version><kafka.version>3.1.0</kafka.version><env.scope>compile</env.scope> <!-- 默认作用域 --></properties><dependencies><!-- Scala Library --><dependency><groupId>org.scala-lang</groupId><artifactId>scala-library</artifactId><version>${scala.version}</version></dependency><!-- Apache Spark --><dependency><groupId>org.apache.spark</groupId><artifactId>spark-core_${scala.simple.version}</artifactId><version>${spark.version}</version><scope>${env.scope}</scope></dependency><!-- Spark SQL --><dependency><groupId>org.apache.spark</groupId><artifactId>spark-sql_${scala.simple.version}</artifactId><version>${spark.version}</version></dependency><!-- Spark 处理kafka的数据 --><dependency><groupId>org.apache.spark</groupId><artifactId>spark-streaming-kafka-0-10_${scala.simple.version}</artifactId><version>${spark.version}</version></dependency><dependency><groupId>org.apache.kafka</groupId><artifactId>kafka-clients</artifactId><version>${kafka.version}</version></dependency></dependencies><profiles><!-- Production profile --><profile><id>prd</id><properties><env.scope>provided</env.scope><env>prd</env></properties></profile><!-- Testing profile --><profile><id>tst</id><properties><env.scope>provided</env.scope><env>tst</env></properties></profile><!-- Development profile --><profile><id>dev</id><properties><env.scope>compile</env.scope><env>dev</env></properties><activation><activeByDefault>true</activeByDefault></activation></profile></profiles><build><finalName>sparkdemo01</finalName><resources><resource><directory>src/main/java</directory></resource><resource><directory>src/main/resources</directory><excludes><exclude>var/*</exclude><exclude>var/*</exclude></excludes></resource><resource><directory>src/main/resources/var</directory><includes><include>${env}.properties</include></includes></resource></resources><plugins><!-- Scala Maven Plugin --><plugin><groupId>net.alchim31.maven</groupId><artifactId>scala-maven-plugin</artifactId><version>4.5.3</version><executions><execution><goals><goal>compile</goal><goal>testCompile</goal></goals></execution></executions><configuration><scalaVersion>${scala.version}</scalaVersion><recompileMode>incremental</recompileMode></configuration></plugin><!-- Maven Compiler Plugin --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.8.1</version><configuration><source>${maven.compiler.source}</source><target>${maven.compiler.target}</target></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>2.6</version><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin></plugins></build></project>

相关文章:

  • LeakSearch:针对网络公开凭证的安全扫描与检测工具
  • 【设计模式】创建型设计模式之 建造者模式
  • 【机器学习】让计算机变得更加智能
  • IDEA创建Maven项目
  • 【设计模式】创建型设计模式之 工厂模式
  • 我要成为算法高手-双指针篇
  • 34.打印K型
  • Vue10-事件修饰符
  • React@16.x(25)useReducer
  • orbslam2代码解读(4):loopclosing回环检测线程
  • 从票务到游戏:Celestia 首届黑客松亮点项目盘点
  • 笨蛋学算法之LeetCodeHot100_2_字母异位词分组(Java)
  • 【机器学习理论基础】定量变量和定性变量
  • 30岁迷茫?AI赛道,人生新起点
  • 【ArcGIS微课1000例】0115:字段数据类型案例详解
  • 【Leetcode】104. 二叉树的最大深度
  • CSS中外联样式表代表的含义
  • es6要点
  • GraphQL学习过程应该是这样的
  • input的行数自动增减
  • opencv python Meanshift 和 Camshift
  • Unix命令
  • Zepto.js源码学习之二
  • 百度贴吧爬虫node+vue baidu_tieba_crawler
  • 回顾 Swift 多平台移植进度 #2
  • 开源地图数据可视化库——mapnik
  • 看图轻松理解数据结构与算法系列(基于数组的栈)
  • 类orAPI - 收藏集 - 掘金
  • 前端js -- this指向总结。
  • 用mpvue开发微信小程序
  • 在 Chrome DevTools 中调试 JavaScript 入门
  • 好程序员大数据教程Hadoop全分布安装(非HA)
  • ​人工智能书单(数学基础篇)
  • ​软考-高级-系统架构设计师教程(清华第2版)【第20章 系统架构设计师论文写作要点(P717~728)-思维导图】​
  • "无招胜有招"nbsp;史上最全的互…
  • # 20155222 2016-2017-2 《Java程序设计》第5周学习总结
  • #Linux(make工具和makefile文件以及makefile语法)
  • #NOIP 2014# day.2 T2 寻找道路
  • (01)ORB-SLAM2源码无死角解析-(66) BA优化(g2o)→闭环线程:Optimizer::GlobalBundleAdjustemnt→全局优化
  • (cljs/run-at (JSVM. :browser) 搭建刚好可用的开发环境!)
  • (笔试题)分解质因式
  • (创新)基于VMD-CNN-BiLSTM的电力负荷预测—代码+数据
  • (二)Eureka服务搭建,服务注册,服务发现
  • (附源码)ssm考试题库管理系统 毕业设计 069043
  • (接口自动化)Python3操作MySQL数据库
  • (新)网络工程师考点串讲与真题详解
  • ***通过什么方式***网吧
  • ./configure,make,make install的作用(转)
  • .NET 8.0 中有哪些新的变化?
  • .net framwork4.6操作MySQL报错Character set ‘utf8mb3‘ is not supported 解决方法
  • .net6+aspose.words导出word并转pdf
  • .net6使用Sejil可视化日志
  • .net安装_还在用第三方安装.NET?Win10自带.NET3.5安装
  • ::前边啥也没有
  • @FeignClient 调用另一个服务的test环境,实际上却调用了另一个环境testone的接口,这其中牵扯到k8s容器外容器内的问题,注册到eureka上的是容器外的旧版本...