wordcountjob打包失败

wordcountjob打包失败

报错信息:
D:\File\bigdata\db_hadoop>mvn clean package -DskipTests
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building db_hadoop 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.132s
[INFO] Finished at: Sun Mar 05 11:26:55 EST 2023
[INFO] Final Memory: 6M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4
.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org
/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/PluginResolutionException
执行mvn -e结果:
D:\File\bigdata\db_hadoop>mvn -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.203s
[INFO] Finished at: Sun Mar 05 11:29:46 EST 2023
[INFO] Final Memory: 6M/121M
[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, g
enerate-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, p
re-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [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 <plugin-group-id

:[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, g
enerate-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-site, site, post-site, site-deploy, pre-clean, clean, post-clean.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:104)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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
看起来时plugin的问题,但是我的配置文件都是按老师的粘贴过去的。
想请老师帮忙看一下这是怎么回事。

正在回答

登陆购买课程后可参与讨论,去登陆

1回答

刚看到这个问题,可能是前面被系统拦截了。


这种问题大概率是由于网络导致的到maven仓库下载依赖出现的问题,解决方法是更换maven的仓库源地址,


参考课程第6周,6-4小节中第2个问题的解决方案处理一下应该就可以了:

https://class.imooc.com/lesson/1682#mid=42998

  • 偏不食肉糜 提问者 #1

    老师抱歉之前在准备期中考试没来得及尝试您的方法。

    我人在国外应该不是网络问题导致的,但是我还是尝试了6-4中的方法,结果还是会报错

    2023-03-12 21:06:39
  • 徐老师 回复 提问者 偏不食肉糜 #2
    那你再试一下这个文章中的解决方案看看怎么样,https://blog.csdn.net/qq_45765882/article/details/119735157
    2023-03-12 21:09:38
  • 偏不食肉糜 提问者 回复 徐老师 #3

    老师我试了还是不行,最近从新过了一遍java和maven的环境配置。问题好像出现在这里:

    https://img1.sycdn.imooc.com//climg/64289e7409ea154e11430841.jpg

    pom.xml文件中这两个plugin一直无法解决,而且我在idea中打开了自动import 手动下载source也没有用

    2023-04-02 05:14:32
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师