解决Maven架设Nexus私服The POM for 。。。。 is missing, no dependency information available问题
问题描述:
学习《Maven实战》,用Nexus架设私服,在做account-kaptcha子模块时,引用
com.google.code.kaptcha:kaptcha:jar:jdk15:2.3 这个包
由于其不在中央仓库中,且根据最佳实践原则,需要在私服中添加一个代理仓库 Sonatype Forge
但是在测试的时候出现以下问题
The POM for com.google.code.kaptcha:kaptcha:jar:jdk15:2.3 is missing, no dependency information available
[ERROR] Failed to execute goal on project account-captcha: Could not resolve dependencies for project com.juvenxu.mvnbook.account:account-captcha:jar:1.0.0-SNAPSHOT: Could not find artifact com.google.code.kaptcha:kaptcha:jar:jdk15:2.3 in nexus (http://localhost:8081/nexus/content/groups/public/) -> [Help 1]
具体如下图:
---------------------------
解决方案:
主要问题是没有将代理仓库添加到仓库组中,导致找不到所要引用的jar包
1.用admin登录nexus私服http://localhost:8081/nexus/
2.右侧导航Views/Repositories-->Repositories-->Public Repositories-->下方Configuration
做如下操作:
3.再次运行mvn test -U (注意加-U)
运行结果如下:
---------------------------
参考: