Nacos 使用maven进行打包 打包失败,如何打包出target?
后端小白,在看开源项目时,配置中心使用的是Nacos,国内Gitee的镜像下载后,发现/bin的同级目录下没有target目录
使用命令行启动:报错说没有找到Jar包
报错信息:
D:\Nacos\distribution\bin>startup.cmd
"nacos is starting with cluster"
Error: Unable to access jarfile D:\Nacos\distribution\target\nacos-server.jar
在CSDN上找到Maven的打包命令,于是在clone 的目录下用命令行执行 如下的打包命令:
mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
但是每次打包都会失败
于是使用IDEA的Maven插件进行Compile
也是报同样的错
报错信息如下:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:23 h
[INFO] Finished at: 2023-04-25T12:57:49+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project nacos-api: Could not resolve dependencies for project com.alibaba.nacos:nacos-api:jar:2.3.0-SNAPSHOT: The following artifacts could not be resolved: io.grpc:grpc-netty-shaded:jar:1.50.2 (absent), com.google.guava:guava:jar:30.1-jre (absent): Could not transfer artifact io.grpc:grpc-netty-shaded:jar:1.50.2 from/to central (https://repo.maven.apache.org/maven2): Read timed out -> [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/DependencyRe...
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :nacos-api
请问怎么能编译出可用的target文件夹和jar包?
回答:
报错提示maven找不到io.grpc:grpc-netty-shaded:jar:1.50.2和com.google.guava:guava:jar:30.1-jre这两个包,可以更改setting.xml换个maven源试试。
以上是 Nacos 使用maven进行打包 打包失败,如何打包出target? 的全部内容, 来源链接: utcz.com/p/945134.html