2013-12-19 69 views
1

我使用maven將工件部署到sonatype nexus,我可以正常執行發佈操作,但是部署快照失敗。mvn將快照部署到nexus oss失敗,返回代碼500內部錯誤

  • Sonatype的關係2.7.0.5
  • 爪哇1.7
  • 行家3.0.5

    1. MVN釋放:準備; MVN釋放:執行;成功沒有任何錯誤
    2. MVN部署失敗,返回碼500
[INFO] maven-jar-plugin:2.4:jar (default-jar) @ licm 
[INFO] Building jar: /foo/licm/trunk/target/licm-0.2.9-SNAPSHOT.jar 
[INFO] 
[INFO] maven-install-plugin:2.3.1:install (default-install) @ licm 
[INFO] Installing /foo/licm/trunk/target/licm-0.2.9-SNAPSHOT.jar to /foo/.m2/repository/com/xxx/utils/licm/0.2.9-SNAPSHOT/licm-0.2.9-SNAPSHOT.jar 
[INFO] Installing /foo/licm/trunk/pom.xml to /foo/.m2/repository/com/xxx/utils/licm/0.2.9-SNAPSHOT/licm-0.2.9-SNAPSHOT.pom 
[INFO] 
[INFO] --- maven-deploy-plugin:2.8.1:deploy (default-deploy) @ licm --- 
Downloading: http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml 
    [WARNING] Could not transfer metadata com.xxx.utils:licm:0.2.9-SNAPSHOT/maven-metadata.xml 
from/to Snapshots (http://xxx.xxx.com:8080/nexus/content/repositories/snapshots): Failed to transfer file: 
http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/ 
maven-metadata.xml. Return code is: 500 , ReasonPhrase:Internal Server Error. 

[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.824s 
[INFO] Finished at: Fri Dec 20 01:20:33 CST 2013 
[INFO] Final Memory: 8M/20M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy) on project licm: Failed to retrieve remote metadata com.xxx.utils:licm:0.2.9-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.xxx.utils:licm:0.2.9-SNAPSHOT/maven-metadata.xml from/to Snapshots (http://xxx.xxx.com:8080/nexus/content/repositories/snapshots): Failed to transfer file: http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml. Return code is: 500 , ReasonPhrase:Internal Server Error. -> [Help 1]" 

這是我第一次部署快照到遠程倉庫,所以也沒什麼快照庫關係服務器上

  • 的settings.xml
<?xml version="1.0"?> 
<settings> 
<servers> 
<server> 
     <id>Releases</id> 
     <username>admin</username> 
     <password>admin123</password> 

</server> 
<server> 
     <id>Snapshots</id> 
     <username>admin</username> 
     <password>admin123</password> 
</server> 
</servers> 
<mirrors> 
<mirror> 
     <id>Nexus</id> 
     <name>Nexus Public Mirror</name> 
     <url>http://xxx.xxx.com:8080/nexus/content/groups/public</url> 
     <mirrorOf>*</mirrorOf> 
</mirror> 

</mirrors> 
</settings> 
  • 的pom.xml
<distributionManagement> 
    <repository> 
     <id>Releases</id> 
     <name>xxx Releases Repositories</name> 
     <url>http://xxx.xxx.com:8080/nexus/content/repositories/releases</url> 
    </repository> 
    <snapshotRepository> 
     <id>Snapshots</id> 
     <name>xxx Snapshots Repositories</name> 
     <url>http://xxx.xxx.com:8080/nexus/content/repositories/snapshots</url> 
    </snapshotRepository> 
    </distributionManagement> 

回答

1

Nexus需要符合Servlet 3.0的容器。它捆綁了一個符合Servlet 3.0的Jetty 8.如果你將它部署在另一個容器上,你必須確保它是兼容的。在文檔中找不到這一點,但從自己的經驗看,似乎是這樣。

當你

HTTP GET http://xxx.xxx.com:8080/nexus/content/repositories/snapshots/com/xxx/utils/licm/0.2.9-SNAPSHOT/maven-metadata.xml

在瀏覽器中,你應該能夠看到堆棧跟蹤,其中包含

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()

這僅僅是3.0的Servlet容器可用。

3

回答自己。

當關系服務器無法找到Maven的metadata.xml中,它會導致tomcat的拋出一個異常,這就是問題所在

我更改Tomcat版本從6.x到的7.0.x,一切是好的

0

我遇到了相同的返回碼(500)和原因(內部服務器錯誤),finnaly發現nexus服務器磁盤空間已滿。 :)檢查服務器中的nexus日誌可以找到這個線索。

相關問題