当前位置:   article > 正文

Flink开发环境搭建指南

Flink开发环境搭建指南

参考文章:Apache Flink-编程指南-项目设置

Flink(三)Flink开发IDEA环境搭建与测试

Flink开发-IDEA scala开发环境搭建

怎样用 Idea 搭建flink项目

1.搭建java-flink开发项目

pom.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <properties>
  7. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  8. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  9. <java.version>1.8</java.version>
  10. <flink.version>1.10.0</flink.version>
  11. <project-name>java-flink</project-name>
  12. </properties>
  13. <groupId>org.fiend.javaflink</groupId>
  14. <artifactId>${project-name}</artifactId>
  15. <version>1.0-SNAPSHOT</version>
  16. <packaging>jar</packaging>
  17. <name>${project-name}</name>
  18. <description>${project-name}</description>
  19. <dependencies>
  20. <!-- flink-java 项目依赖库配置 -->
  21. <dependency>
  22. <groupId>org.apache.flink</groupId>
  23. <artifactId>flink-java</artifactId>
  24. <version>${flink.version}</version>
  25. <scope>provided</scope>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.apache.flink</groupId>
  29. <artifactId>flink-streaming-java_2.11</artifactId>
  30. <version>${flink.version}</version>
  31. <scope>provided</scope>
  32. </dependency>
  33. ...
  34. </dependencies>
  35. ...
  36. </project>

2.搭建scala-flink开发项目

pom.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <properties>
  7. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  8. <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  9. <java.version>1.8</java.version>
  10. <flink.version>1.10.0</flink.version>
  11. <project-name>scala-flink</project-name>
  12. </properties>
  13. <groupId>org.fiend.scalaflink</groupId>
  14. <artifactId>${project-name}</artifactId>
  15. <version>1.0-SNAPSHOT</version>
  16. <packaging>jar</packaging>
  17. <name>${project-name}</name>
  18. <description>${project-name}</description>
  19. <dependencies>
  20. <!-- flink-java 项目依赖库配置 -->
  21. <dependency>
  22. <groupId>org.apache.flink</groupId>
  23. <artifactId>flink-scala_2.11</artifactId>
  24. <version>${flink.version}</version>
  25. <scope>provided</scope>
  26. </dependency>
  27. <dependency>
  28. <groupId>org.apache.flink</groupId>
  29. <artifactId>flink-streaming-scala_2.11</artifactId>
  30. <version>${flink.version}</version>
  31. <scope>provided</scope>
  32. </dependency>
  33. ...
  34. </dependencies>
  35. ...
  36. </project>

批处理环境搭建

1.IDEA新建maven项目

在这里插入图片描述

2.创建项目

在这里插入图片描述

3. 添加scala文件夹

在这里插入图片描述

4.增加scala配置

在这里插入图片描述

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/972581
推荐阅读
相关标签