1. 程式人生 > >解決Maven架設Nexus私服no dependency information available問題

解決Maven架設Nexus私服no dependency information available問題

解決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)

執行結果如下:


---------------------------

參考: