使用maven网站插件和命令:
mvn clean install deploy site site:deploy
尝试部署每个站点文件时,会给出一系列错误消息:
Transfer finished. 3824 bytes copied in 0.015 seconds
Transfer error: java.io.IOException: Unable to create collection: https://repo.icatproject.org/repository/; status code = 400
Uploading: .//apidocs/allclasses-frame.html to https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/
#https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/allclasses-frame.html - Status code: 201
Transfer finished. 924 bytes copied in 0.015 seconds
Transfer error: java.io.IOException: Unable to create collection: https://repo.icatproject.org/repository/; status code = 400
Uploading: .//apidocs/script.js to https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/
#https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js - Status code: 400
Transfer error: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js. Return code is: 400
https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1- SNAPSHOT/ - Session: Disconnecting
https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/ - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.155 s
[INFO] Finished at: 2016-05-11T11:04:11+01:00
[INFO] Final Memory: 34M/408M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:deploy (default-cli) on project a.a1: Error uploading site: Failed to transfer file: https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js. Return code is: 400 -> [Help 1]
错误消息显示在sonatype v3文档的示例中。结构与http://books.sonatype.com/nexus-book/3.0/reference/raw.html#_publishing_a_maven_site的结构相同,带有一系列400个错误代码,但是在我遇到BUILD FAILURE的情况下,它们会获得[INFO] BUILD SUCCESS。
答案 0 :(得分:0)
传输错误:org.apache.maven.wagon.TransferFailedException:失败 转移文件: https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js。 返回码为:400
我们书中的输出与您的部署略有不同。
在输出中构建失败的400响应来自文件部署,其中本书仅用于目录路径MKCOL请求。
文件部署(不是目录)的400响应的一个原因是该文件已存在于存储库中,存储库部署策略可防止覆盖现有文件。
转到Nexus中的maven-sites存储库配置。确保“部署策略”设置为“允许重新部署” - 然后再次尝试部署。
如果它仍然不起作用,服务器上的nexus.log中应该有更多信息。