? 打包后上传到 spark-submit 提交,报错集群找不到class
创建是object文件,main方法可执行,在此确定代码编写没问题,寻找别的原因
clean 后重新打包,发现无效
更换打包方法
去看maven配置,最后在pom.xml找到原因,翻看博客发现相比之前少写了一项配置
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
PS:这是应该放到 scala-maven-plugin
中的
重新package打包上传,sparl-submit运行成功
? 去网上查询插件相关内容:scala-maven-plugin
是用来让maven能够编译、测试、运行scala项目的
<goal>compile</goal>编译scala code
<goal>testCompile</goal>编译test code
原文:https://www.cnblogs.com/xp-thebest/p/14295887.html