net.alchim31.maven:scala-maven-plugin:maven依赖无法下载或无法编译

 

背景:

测试spark代码时,部分类无法正常导入,具体原因是部分maven依赖没有下载下来,导致类无法正常导入;

原因:

package默认只处理java源代码的编译、打包,而不管scala;

解决方法:

mvn clean scala:compile compile package

net.alchim31.maven:scala-maven-plugin:maven依赖无法下载或无法编译_第1张图片

其他类似情况:

[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.0:compile (default) on project iteblog: wrap: org.apache.commons.exec.ExecuteException:

 Process exited with an error: 1 (Exit value: 1) -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit

ch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.


[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

原因:

package默认只处理java源代码的编译、打包,而不管scala,所以编译时遇到Hello这个由scala语言编写的class,此时scala还没编译生成class,所以找不到相应的调用入口。 

解决方法:

mvn clean scala:compile compile package

你可能感兴趣的:(每日随笔,spark)