如果我嘗試使用命令上傳一個jar不能上傳一個工件在Nexus倉庫
mvn deploy:deploy-file \
-DgroupId=log4j \
-DartifactId=log4j-gwt \
-Dversion=1.0 \
-Dpackaging=jar \
-Dfile=log4j-gwt.jar \
-DrepositoryId=nexus \
-Durl=http://2.23.45.65:8081/nexus/content/repositories/central
我得到錯誤
Downloaded: http://2.23.45.65:8081/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.jar (0 B at 0.0 KB/sec)
Uploading: http://2.23.45.65:8081/nexus/content/repositories/central/log4j/log4j-gwt/1.0/log4j-gwt-1.0.jar
Uploading: http://2.23.45.65:8081/nexus/content/repositories/central/log4j/log4j-gwt/1.0/log4j-gwt-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.964s
[INFO] Finished at: Mon Mar 21 16:45:42 MSK 2016
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project gwtclient: Failed to deploy artifacts: Could not transfer artifact log4j:log4j-gwt:jar:1.0 from/to nexus (http://2.23.45.65:8081/nexus/content/repositories/central): Failed to transfer file: http://2.23.45.65:8081/nexus/content/repositories/central/log4j/log4j-gwt/1.0/log4j-gwt-1.0.jar. Return code is: 401
描述如下倉庫的Nexus如何在settings.xml
配置<mirror>
<id>nexus</id>
<url>http://2.23.45.65:8081/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
此外我試圖配置組/公共存儲庫。 Settings.XML中
<server>
<id>nexus_public</id>
<username>username</username>
<password>passwd</password>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
<configuration></configuration>
</server>
在pom.xml中
<repositories>
<repository>
<id>nexus_public</id>
<url>http://2.23.45.65:8081/nexus/content/groups/public/</url>
</repository>
</repositories>
,並試圖運行命令
mvn deploy:deploy-file \
-DgroupId=log4j \
-DartifactId=log4j-gwt \
-Dversion=1.0 \
-Dpackaging=jar \
-Dfile=log4j-gwt.jar \
-DrepositoryId=nexus_public \
-Durl=http://2.23.45.65:8081/nexus/content/groups/public
,但我得到同樣的錯誤。
而且我試圖找到組件上傳標籤,如本文 https://books.sonatype.com/nexus-book/reference/using-sect-uploading.html
中描述,但我找不到在Nexus的倉庫經理OSS此選項卡。 這應該在選項卡摘要之後,但它不在那裏。
你從哪裏找到jar'log4j-gwt'?因爲我沒有找到它在存儲庫maven – Hohenheim
基於錯誤消息'返回代碼是:401'我會假設您的憑據或您的配置,這是不好的... – khmarbaise
@Hhenhenheim我沒有找到log4j-gwt也在Maven倉庫中。在配置好你的網絡設置(代理)之後,我已經在https://sourceforge.net/projects/log4j-gwt/ – ETartaren