IDEA 中maven 工程 ----Spark依赖管理
来源:互联网 发布:车铣复合加工编程基础 编辑:程序博客网 时间:2024/06/03 17:58
一.安装maven1.下载maven 二进制安装包 2.解压修改目录,移动到/usr/maventar -xzvf apache-maven-3.5.0-bin.tar.gzmv apache-maven-3.5.0-bin /usr/maven3.53.配置环境变量vim .profileexport M2_HOME=/usr/maven3.5/apache-maven-3.5.0export PATH=$PATH:$M2_HOME/bin生效配置 source ~/.profile4.测试是否成功mvn -version 二创建spark工程1.在IDEA 创建工程2 .勾选Createfrom archetype
5.完成后,会自动导入以来
6.进行POM.xml配置,如下
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.shentu.cn</groupId>
<artifactId>SparkRM</artifactId>
<version>1.0-SNAPSHOT</version>
<inceptionYear>2008</inceptionYear>
<!-- 只修改此处即可动态更改,scala,spark相关jar 包版本-->
<properties>
<scala.version>2.11.8</scala.version>
<spark.artifactID.suffix>2.10</spark.artifactID.suffix>
<spark.version>2.0.0</spark.version>
</properties>
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-Tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.specs</groupId>
<artifactId>specs</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<!-- spark -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${spark.artifactID.suffix}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_${spark.artifactID.suffix}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${spark.artifactID.suffix}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_${spark.artifactID.suffix}</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_${spark.artifactID.suffix}</artifactId>
<version>${spark.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-target:jvm-1.8</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<downloadSources>true</downloadSources>
<buildcommands>
<buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
</buildcommands>
<additionalProjectnatures>
<projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
</additionalProjectnatures>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
<classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
</classpathContainers>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
阅读全文
0 0
- IDEA 中maven 工程 ----Spark依赖管理
- IDEA中Maven管理下添加mysql依赖
- idea中maven依赖图
- IDEA中maven依赖图
- idea创建maven工程的spark项目
- 使用IDEA+MAVEN管理项目依赖
- idea中创建maven依赖下的web工程(一)----用户登录界面
- Intellij idea使用Maven管理Scala工程
- idea中maven下载依赖包慢
- idea 中maven依赖加载失败
- Intellij IDEA中Maven解决依赖失效
- Maven-子工程使用依赖以及Parent中的依赖管理
- Intellij idea 解决 maven工程的部分依赖问题
- 【Maven】持续交付环境中,组件工程依赖管理的配置与检查
- idea中使用Maven创建web工程
- idea中如何新建一个maven工程
- IntelliJ IDEA的JDK环境配置和Maven依赖管理
- idea maven 编译 spark
- 作业控制( Job control )
- 1021. 个位数统计 (15)
- python理解面向对象之封装
- facebook的python时间序列工具fbprophet
- linux 操作系统装好后如何 配置IP地址
- IDEA 中maven 工程 ----Spark依赖管理
- PG-HGDB 把WAL位置转换成WAL文件名和偏移量
- 王者的荣耀、男人的战争都是为了女人!
- 在NGUI的UILabel中使用动态字体与表情
- cmd命令_关闭学生端控屏软件_关闭卡死程序_解除任务管理器禁用
- 抽奖问题(switch())
- 骑车网站加载动画
- javascript冒泡排序
- 求从1-100内含9的数字的个数