首页 > 数据库 >DataX实战之MongoDB导入数据到mysql——打包jar包时出现Could not find goal assembly in plugin org.apache.maven.plugins

DataX实战之MongoDB导入数据到mysql——打包jar包时出现Could not find goal assembly in plugin org.apache.maven.plugins

时间:2024-09-07 12:25:12浏览次数:9  
标签:assembly goal plugin maven 点击 源码 ERROR apache 下载

使用 idea 打开我们本地的 datax 源码或者下载的源码

下载地址:https://github.com/alibaba/DataX/blob/master/mongodbreader/doc/mongodbreader.md

进行编译,打包上传:

指定mongodbreader模块 以及 它所依赖的模块进行打包 【推荐使用,大约只运行 3 分钟左右】

mvn -U clean package -pl mongodbreader -am  assembly:assembly '-Dmaven.test.skip=true'

报错

如果出现下面的报错可能是maven版本不匹配

这里我用的是apache-maven-3.9.8

[ERROR] No plugin found for prefix '.apache.maven.plugins' in the current project and in the plugin groups [org.
apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\Code\maven_repository), alim
aven (https://maven.aliyun.com/repository/public)]  -> [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/NoPluginFoundForPrefixException

 在IDEA中修改maven版本

 把maven版本改为apache-maven-3.6.1,删除之前加载的datax 源码,重新加载datax 源码就可以成功打包jar包

1.下载

1.点击文章上方安装包下载

2.官网下载:

https://maven.p2hp.com/

 1.点击Download下滑找到其他版本点击Maven3档案

2.找到maven3.6.1点击

3.点击 binaries 下载

4.点击 zip 格式

下载完成后放入你自己maven所在的路径解压缩

2.配置maven环境变量

1.此电脑鼠标右键属性

2.高级系统设置

3.环境变量

系统变量找到你之前配置的maven修改为新的maven版本

3.在IDEA中修改maven配置

1.打开IDEA

点击file>>Settings>>Build>>Build Tools>>Maven

2.修改maven

Maven home path: 你的maven所安装的路径

User settings file:  settings.xml径

Local repository: 你的maven仓库所在的路径

修改完成后点击Apply,点击OK

4.重新加载Datax源码

修改完成后重新加载Datax源码重启IDEA再次打包就可以运行成功

标签:assembly,goal,plugin,maven,点击,源码,ERROR,apache,下载
From: https://blog.csdn.net/weixin_64726356/article/details/141992663

相关文章