maven编译spark Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:testCompile

今天在用maven编译spark的时候,遇到一个错误,见下图
在这里插入图片描述
在这里插入图片描述

而且没有更多的报错信息,在网上找了很多帖子,方法就是在编译之前,执行

sh change-scala-version.sh 2.11

根据自己所用的scala版本,如果是10就执行2.10。但是我是执行了这个命令的。还是报这个错误。而且用命令mvn -X查看结果为

[hadoop@hadoop001 ~]$ mvn -X Apache Maven 3.3.9
(bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /opt/software/apache-maven-3.3.9 Java version: 1.8.0_45,
vendor: Oracle Corporation Java home: /usr/java/jdk1.8.0_45/jre
Default locale: en_US, platform encoding: UTF-8 OS name: “linux”,
version: “2.6.32-696.6.3.el6.x86_64”, arch: “amd64”, family: “unix”
[DEBUG] Created new class realm maven.api [DEBUG] Importing foreign
packages into class realm maven.api [DEBUG] Imported:
javax.enterprise.inject.* < plexus.core [DEBUG] Imported:
javax.enterprise.util.* < plexus.core [DEBUG] Imported:
javax.inject.* < plexus.core [DEBUG] Imported: org.apache.maven.* <
plexus.core [DEBUG] Imported: org.apache.maven.artifact <
plexus.core [DEBUG] Imported: org.apache.maven.classrealm <
plexus.core [DEBUG] Imported: org.apache.maven.cli < plexus.core
[DEBUG] Imported: org.apache.maven.configuration < plexus.core
[DEBUG] Imported: org.apache.maven.exception < plexus.core [DEBUG]
Imported: org.apache.maven.execution < plexus.core [DEBUG] Imported:
org.apache.maven.execution.scope < plexus.core [DEBUG] Imported:
org.apache.maven.lifecycle < plexus.core [DEBUG] Imported:
org.apache.maven.model < plexus.core [DEBUG] Imported:
org.apache.maven.monitor < plexus.core [DEBUG] Imported:
org.apache.maven.plugin < plexus.core [DEBUG] Imported:
org.apache.maven.profiles < plexus.core [DEBUG] Imported:
org.apache.maven.project < plexus.core [DEBUG] Imported:
org.apache.maven.reporting < plexus.core [DEBUG] Imported:
org.apache.maven.repository < plexus.core [DEBUG] Imported:
org.apache.maven.rtinfo < plexus.core [DEBUG] Imported:
org.apache.maven.settings < plexus.core [DEBUG] Imported:
org.apache.maven.toolchain < plexus.core [DEBUG] Imported:
org.apache.maven.usability < plexus.core [DEBUG] Imported:
org.apache.maven.wagon.* < plexus.core [DEBUG] Imported:
org.apache.maven.wagon.authentication < plexus.core [DEBUG]
Imported: org.apache.maven.wagon.authorization < plexus.core [DEBUG]
Imported: org.apache.maven.wagon.events < plexus.core [DEBUG]
Imported: org.apache.maven.wagon.observers < plexus.core [DEBUG]
Imported: org.apache.maven.wagon.proxy < plexus.core [DEBUG]
Imported: org.apache.maven.wagon.repository < plexus.core [DEBUG]
Imported: org.apache.maven.wagon.resource < plexus.core [DEBUG]
Imported: org.codehaus.classworlds < plexus.core [DEBUG] Imported:
org.codehaus.plexus.* < plexus.core [DEBUG] Imported:
org.codehaus.plexus.classworlds < plexus.core [DEBUG] Imported:
org.codehaus.plexus.component < plexus.core [DEBUG] Imported:
org.codehaus.plexus.configuration < plexus.core [DEBUG] Imported:
org.codehaus.plexus.container < plexus.core [DEBUG] Imported:
org.codehaus.plexus.context < plexus.core [DEBUG] Imported:
org.codehaus.plexus.lifecycle < plexus.core [DEBUG] Imported:
org.codehaus.plexus.logging < plexus.core [DEBUG] Imported:
org.codehaus.plexus.personality < plexus.core [DEBUG] Imported:
org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core [DEBUG] Imported:
org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core [DEBUG]
Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException <
plexus.core [DEBUG] Imported:
org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core [DEBUG]
Imported: org.eclipse.aether.* < plexus.core [DEBUG] Imported:
org.eclipse.aether.artifact < plexus.core [DEBUG] Imported:
org.eclipse.aether.collection < plexus.core [DEBUG] Imported:
org.eclipse.aether.deployment < plexus.core [DEBUG] Imported:
org.eclipse.aether.graph < plexus.core [DEBUG] Imported:
org.eclipse.aether.impl < plexus.core [DEBUG] Imported:
org.eclipse.aether.installation < plexus.core [DEBUG] Imported:
org.eclipse.aether.internal.impl < plexus.core [DEBUG] Imported:
org.eclipse.aether.metadata < plexus.core [DEBUG] Imported:
org.eclipse.aether.repository < plexus.core [DEBUG] Imported:
org.eclipse.aether.resolution < plexus.core [DEBUG] Imported:
org.eclipse.aether.spi < plexus.core [DEBUG] Imported:
org.eclipse.aether.transfer < plexus.core [DEBUG] Imported:
org.eclipse.aether.version < plexus.core [DEBUG] Imported:
org.slf4j.* < plexus.core [DEBUG] Imported: org.slf4j.helpers.* <
plexus.core [DEBUG] Imported: org.slf4j.spi.* < plexus.core [DEBUG]
Populating class realm maven.api [INFO] Error stacktraces are turned
on. [DEBUG] Reading global settings from
/opt/software/apache-maven-3.3.9/conf/settings.xml [DEBUG] Reading
user settings from /home/hadoop/.m2/settings.xml [DEBUG] Reading
global toolchains from
/opt/software/apache-maven-3.3.9/conf/toolchains.xml [DEBUG] Reading
user toolchains from /home/hadoop/.m2/toolchains.xml [DEBUG] Using
local repository at /home/hadoop/maven_repo [DEBUG] Using manager
EnhancedLocalRepositoryManager with priority 10.0 for
/home/hadoop/maven_repo [INFO] Scanning for projects… [DEBUG]
Extension realms for project org.apache.maven:standalone-pom:pom:1:
(none) [DEBUG] Looking up lifecyle mappings for packaging pom from
ClassRealm[plexus.core, parent: null] [INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 0.092 s [INFO] Finished at:
2018-11-07T15:48:49+08:00 [INFO] Final Memory: 5M/106M [INFO]
------------------------------------------------------------------------ [ERROR] No goals have been specified for this build. You must specify
a valid lifecycle phase or a goal in the format :
or :[:]:.
Available lifecycle phases are: validate, initialize,
generate-sources, process-sources, generate-resources,
process-resources, compile, process-classes, generate-test-sources,
process-test-sources, generate-test-resources, process-test-resources,
test-compile, process-test-classes, test, prepare-package, package,
pre-integration-test, integration-test, post-integration-test, verify,
install, deploy, pre-clean, clean, post-clean, pre-site, site,
post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have
been specified for this build. You must specify a valid lifecycle
phase or a goal in the format : or
:[:]:.
Available lifecycle phases are: validate, initialize,
generate-sources, process-sources, generate-resources,
process-resources, compile, process-classes, generate-test-sources,
process-test-sources, generate-test-resources, process-test-resources,
test-compile, process-test-classes, test, prepare-package, package,
pre-integration-test, integration-test, post-integration-test, verify,
install, deploy, pre-clean, clean, post-clean, pre-site, site,
post-site, site-deploy. at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:94)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] [ERROR] [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/NoGoalSpecifiedException

按照这个错误信息也没有找到解决办法。最后终于发现一个pom里面的设置可能是导致问题的关键。

<useZincServer>true</useZincServer>

Zinc是一个用来加速编译的服务,暂且不知道具体是如何影响编译的。但是把值改为
false之后,编译成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值