Loading... 在一次普通的发布过程中,编译打包JAVA程序阶段,遇到了如下问题: ![2024-03-20T08:35:51.png][1] ``` Could not find artifact net.bytebuddy:byte-buddy:jar ``` 询问GPT,给出了应该配置一下更新一下pom。 ``` <dependency> <groupId>net.bytebuddy</groupId> <artifactId>byte-buddy</artifactId> <version>[version]</version> </dependency> ``` 但是做了一下之后,还是报那个错误。 尝试找到在nexus的对应目录 ``` cd nexus/storage/central/.nexus/attributes/net/bytebuddy/byte-buddy/ ``` 发现里面确实没有1.14.9 找到了byte-buddy它的网站,https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.14.9/,手动下载并上传。 这时候,nexus网站里面可以看到1.14.9 ![2024-03-20T08:39:04.png][2] 但是,编译打包还是报错。但是可以在nexus里面看到pom文件了。 下图是后来补的图,其实之前是有type参数配置配置的。 ![2024-03-20T08:41:08.png][3] 将以下配置(带有type参数)放到JAVA代码的pom.xml文件中。 ``` <dependency> <groupId>net.bytebuddy</groupId> <artifactId>byte-buddy-parent</artifactId> <version>1.14.9</version> <type>pom</type> </dependency> ``` 编译通过了。 感觉晕晕的了。 * 为啥将所有下载的1.14.9的jar pom等文件直接放进去没有用? * 为啥只有pom文件生效有用了? * 为啥配置完成后pom,带有type参数的就可以了?编译打包阶段下载很慢,估计jar包文件又被从网站上下载了一遍?从时间上看确实是重新下载了。 ![2024-03-20T08:50:23.png][4] 也许下次可以试下repair index ![2024-03-20T08:51:41.png][5] * 为啥最后在nexus页面看到的没有type字样了? * 手动打开nexus页面,发现只有几个文件,而不是全部目录? ![2024-03-20T09:29:04.png][6] [1]: https://www.sddts.cn/usr/uploads/2024/03/2523174093.png [2]: https://www.sddts.cn/usr/uploads/2024/03/467272953.png [3]: https://www.sddts.cn/usr/uploads/2024/03/2488447638.png [4]: https://www.sddts.cn/usr/uploads/2024/03/2936078304.png [5]: https://www.sddts.cn/usr/uploads/2024/03/3536686750.png [6]: https://www.sddts.cn/usr/uploads/2024/03/2498331747.png 最后修改:2024 年 05 月 11 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏