我有一个Jenkins项目,它使用Jenkins上传工件到nexus插件进行gradle构建并将构建工件上传到Nexus maven托管存储库。当我使用Nexus 2.13时工作正常 - 但升级到Nexus 3后,上传到Nexus的工作不再有效。我已经确定我已经像Nexus 2.13存储库一样配置了Nexus 3存储库。当我构建我的Jenkins项目时,我得到了回复
GroupId: com.company
ArtifactId: hello-world-util
Version: 1.0.0
File: hello-world-util-1.0.0.jar
Repository:companyDevops
Uploading artifact hello-world-util-1.0.0.jar started....
Reason Phrase: Method Not Allowed
<!DOCTYPE html>
<html>
<head>
<title>405 - Nexus Repository Manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--[if lt IE 9]>
<script>(new Image).src="http://192.168.99.100:18081/favicon.ico?3.0.1-01"</script>
<![endif]-->
<link rel="icon" type="image/png" href="http://192.168.99.100:18081/favicon-32x32.png?3.0.1-01" sizes="32x32">
<link rel="mask-icon" href="http://192.168.99.100:18081/safari-pinned-tab.svg?3.0.1-01" color="#5bbad5">
<link rel="icon" type="image/png" href="http://192.168.99.100:18081/favicon-16x16.png?3.0.1-01" sizes="16x16">
<link rel="shortcut icon" href="http://192.168.99.100:18081/favicon.ico?3.0.1-01">
<meta name="msapplication-TileImage" content="http://192.168.99.100:18081/mstile-144x144.png?3.0.1-01">
<meta name="msapplication-TileColor" content="#00a300">
<link rel="stylesheet" type="text/css" href="http://192.168.99.100:18081/static/css/nexus-content.css?3.0.1-01"/>
</head>
<body>
<div class="nexus-header">
<a href="http://192.168.99.100:18081">
<div class="product-logo">
<img src="http://192.168.99.100:18081/static/images/nexus.png?3.0.1-01"/>
</div>
<div class="product-id">
<div class="product-id__line-1">
<span class="product-name">Nexus Repository Manager</span>
</div>
<div class="product-id__line-2">
<span class="product-spec">OSS 3.0.1-01</span>
</div>
</div>
</a>
</div>
<div class="nexus-body">
<div class="content-header">
<img src="http://192.168.99.100:18081/static/rapture/resources/icons/x32/exclamation.png?3.0.1-01"/>
<span class="title">Error 405</span>
<span class="description">Method Not Allowed</span>
</div>
<div class="content-body">
<div class="content-section">
HTTP method POST is not supported by this URL
</div>
</div>
</div>
</body>
</html>
我的Jenkins nexus上传配置为(并且在Nexus 2.13和3之间没有变化)
Upload artifact to nexus
Nexus Details
Protocol HTTP
Nexus URL 192.168.99.100:18081
User admin
Password admin123
Credentials com.company
GroupId com.company
ArtifactId hello-world-ui
Version 1.0.0
Packaging jar
Repository companyDevops
File build/libs/hello-world-util-1.0.0.jar
我的Nexus 3 maven托管存储库配置为
Name companyDevops
Format maven2
Type hosted
URL http://192.168.99.100:18081/repository/companyDevops/
Online
Maven 2
Version policy Release
Layout policy Strict
Storage
Blog store default
Strict content type validation X
Hosted
Deployment policy Allow redeploy
不确定我为什么会收到此错误 - 我已验证Nexus管理员用户有权上传工件 - 我已经验证允许重新部署
可能会发生什么 - Jenkins'上传神器到nexus'的插件可能与Nexus 3不兼容?
有没有人让这个与Nexus 3一起使用?有什么建议吗?
谢谢!
答案 0 :(得分:3)
Nexus Artifact Uploader插件现在支持Nexus-2.x&amp; NEXUS-3.X。 使用插件版本2.6支持Nexus-3.x. https://wiki.jenkins-ci.org/display/JENKINS/Nexus+Artifact+Uploader
答案 1 :(得分:1)
请使用&#34; Nexus Artifact Uploader&#34;,下面是网址,也支持nexus 3.
https://plugins.jenkins.io/nexus-artifact-uploader
安装插件后,我们会在构建部分获得nexus artifact uploader。
答案 2 :(得分:0)
此插件不支持Nexus-3.x,我们正在努力向Nexus-3.x提供上传工件的功能