简介 目录 评价 推荐
  • 慕雪3103829 2021-04-26
    找不到依赖
    已采纳 徐老师 的回答

    pom.xml文件吗?

    我把这个文件的内容贴出来一下:

    这个是Hadoop代码需要用到的

    <dependencies>
    
    <!-- hadoop的依赖 -->
    <dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-client</artifactId>
    <version>3.2.0</version>
    <!-- provided表示这个依赖只在编译的时候,执行或者打jar包的时候都不使用 -->
    <!--<scope>provided</scope>-->
    </dependency>
    
    <!-- log4j的依赖 -->
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.10</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.10</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    </dependencies>
    
    <build>
    <plugins>
    <!-- compiler插件, 设定JDK版本 -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
    <encoding>UTF-8</encoding>
    <source>1.8</source>
    <target>1.8</target>
    <showWarnings>true</showWarnings>
    </configuration>
    </plugin>
    <plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
    <descriptorRefs>
    <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
    <archive>
    <manifest>
    <mainClass></mainClass>
    </manifest>
    </archive>
    </configuration>
    <executions>
    <execution>
    <id>make-assembly</id>
    <phase>package</phase>
    <goals>
    <goal>single</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>


    下面这个是flink代码需要用到的。

    <dependencies>
    
    <dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-java</artifactId>
    <version>1.11.1</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-streaming-java_2.12</artifactId>
    <version>1.11.1</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-scala_2.12</artifactId>
    <version>1.11.1</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-streaming-scala_2.12</artifactId>
    <version>1.11.1</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-clients_2.12</artifactId>
    <version>1.11.1</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <!-- log4j的依赖 -->
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.10</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.10</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    <dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-client</artifactId>
    <version>3.2.0</version>
    <!--<scope>provided</scope>-->
    </dependency>
    
    </dependencies>
    <build>
    <plugins>
    <!-- 编译插件 -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.6.0</version>
    <configuration>
    <source>1.8</source>
    <target>1.8</target>
    <encoding>UTF-8</encoding>
    </configuration>
    </plugin>
    <!-- scala编译插件 -->
    <plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <version>3.1.6</version>
    <configuration>
    <scalaCompatVersion>2.12</scalaCompatVersion>
    <scalaVersion>2.12.11</scalaVersion>
    <encoding>UTF-8</encoding>
    </configuration>
    <executions>
    <execution>
    <id>compile-scala</id>
    <phase>compile</phase>
    <goals>
    <goal>add-source</goal>
    <goal>compile</goal>
    </goals>
    </execution>
    <execution>
    <id>test-compile-scala</id>
    <phase>test-compile</phase>
    <goals>
    <goal>add-source</goal>
    <goal>testCompile</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    <!-- 打jar包插件(会包含所有依赖) -->
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>2.6</version>
    <configuration>
    <descriptorRefs>
    <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
    <archive>
    <manifest>
    <!-- 可以设置jar包的入口类(可选) -->
    <mainClass></mainClass>
    </manifest>
    </archive>
    </configuration>
    <executions>
    <execution>
    <id>make-assembly</id>
    <phase>package</phase>
    <goals>
    <goal>single</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>


    1回答·500浏览
  • 是梦_不萌 2021-04-26
    flink学习前面需要什么基础?

    1:课程中用到了flink on yarn模式,所以需要有Hadoop基础。

    2:开发flink代码需要用到scala语言或者java语言,所以至少要有java基础。

    1回答·1008浏览
  • 慕粉2122507492 2021-01-16
    请问有对应的flink镜像供下载吗

    你是需要带有fink安装环境的虚拟机镜像吗?

    这个暂时没有,可以加一下慕课大数据学习qun:938632081,在安装的时候有问题可以随时沟通

    1回答·539浏览
  • 无价脂宝 2020-12-26
    跟着老师敲,和老师的MAVEN 里面的jar 包版本也一样。但是为啥报错呢? 调用的方法传参不一样呢?

    可以加到慕课大数据学习qun中,方便及时沟通遇到的问题,qun号:938632081

    2回答·482浏览
数据加载中...