Maven 发布 ->对等体未通过身份验证 [英] maven release -> peer not authenticated

查看:30
本文介绍了Maven 发布 ->对等体未通过身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试发布我的软件(我以前从未这样做过),到目前为止我已经能够执行 mvn release:prepare.当我执行 release:perform 时,我收到以下错误:

<前>[INFO] [ERROR] 无法执行目标 org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) 项目 img2stl:无法部署工件:C不会将工件 nl.byterendition:img2stl:jar:0.9 从/到 byterendition-releases (https://localhost:443/svn/repo/releases): peer 未认证 ->[帮助1]

我已经在 localhost:443 上设置了一个本地密码保护的 svn 存储库,所以我将以下内容添加到我的 .m2 文件夹中的 settings.xml

编辑包括埃德温巴克的回答:

<服务器><服务器><id>byterendition-releases</id><用户名>用户名</用户名><密码>密码</密码></服务器><服务器><id>byterendition-snapshots</id><用户名>用户名</用户名><密码>密码</密码></服务器></服务器></设置>

这是我的 pom 的有用部分:

<存储库><id>byterendition-releases</id><url>https://localhost:443/svn/repo/releases</url></repository><快照存储库><id>byterendition-snapshots</id><url>https://localhost:443/svn/repo/snapshots</url></snapshotRepository></distributionManagement>

如何让 maven 访问 svn 存储库?

好的,正如 Edwin Buck 建议我不应该使用 localhost,但由于我无法让它工作,否则我想我会使用我用于工作的远程 SVN 服务器来尝试这个.现在我得到一个不同的错误:

<前>[INFO] [ERROR] 无法执行目标 org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) 项目 img2stl:无法部署工件:C不能将工件 nl.byterendition:img2stl:jar:0.9.5 从/到 byterendit离子释放(https://svn.science.ru.nl/repos/estens/releases/):无法转换文件:https://svn.science.ru.nl/repos/estens/releases/nl/byterendition/img2stl/0.9.5/img2stl-0.9.5.jar.返回码为:409,ReasonPhrase:冲突.-> [地狱1]

我再次可以从 Eclipse 访问这个 repo.有谁知道我做错了什么?

解决方案

自 3.0.5 版起,Maven 会检查 https 连接上的 SSL 证书.您可以通过添加命令行参数来临时修复此问题

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

将 SSL 证书安装到您的 JRE 中应该可以永久解决该问题.

官方文档:http://maven.apache.org/wagon/wagon-providers/wagon-http/

I'm experimenting a bit with releasing my software (I've never done this before) and so far I've been able to execute mvn release:prepare. As I'm executing release:perform I get the following error:

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plug
in:2.7:deploy (default-deploy) on project img2stl: Failed to deploy artifacts: C
ould not transfer artifact nl.byterendition:img2stl:jar:0.9 from/to byterenditio
n-releases (https://localhost:443/svn/repo/releases): peer not authenticated ->
[Help 1]

I've set up a local password protected svn repository at localhost:443, so I added the following to my settings.xml in my .m2 folder

EDITED TO INCLUDE Edwin Buck's answer:

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <servers>
        <server>
            <id>byterendition-releases</id>
            <username>username</username>
            <password>password</password>
        </server>
        <server>
            <id>byterendition-snapshots</id>
            <username>username</username>
            <password>password</password>
        </server>
    </servers>
</settings>

This is the useful section of my pom:

<distributionManagement>
    <repository>
        <id>byterendition-releases</id>
        <url>https://localhost:443/svn/repo/releases</url>
    </repository>
    <snapshotRepository>
        <id>byterendition-snapshots</id>
        <url>https://localhost:443/svn/repo/snapshots</url>
    </snapshotRepository>
</distributionManagement>

How can I get maven to access the svn repository?

Ok, as Edwin Buck suggested I shouldn't use localhost, but since I haven't been able to get it to work otherwise I thought I'd try this using a remote SVN server I use for work. Now I get a different error:

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plug
in:2.7:deploy (default-deploy) on project img2stl: Failed to deploy artifacts: C
ould not transfer artifact nl.byterendition:img2stl:jar:0.9.5 from/to byterendit
ion-releases (https://svn.science.ru.nl/repos/estens/releases/): Failed to trans
fer file: https://svn.science.ru.nl/repos/estens/releases/nl/byterendition/img2s
tl/0.9.5/img2stl-0.9.5.jar. Return code is: 409, ReasonPhrase: Conflict. -> [Hel
p 1]

Again I can access this repo from Eclipse. Does anyone know what I'm doing wrong?

解决方案

Since version 3.0.5 Maven checks the SSL certificate on https connections. You can temporarily fix this by adding the command line parameters

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

Installing the SSL certificate into your JRE should permanently fix the issue.

Official documentation: http://maven.apache.org/wagon/wagon-providers/wagon-http/

这篇关于Maven 发布 ->对等体未通过身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆