密码保护詹金斯Maven仓库服务器 - 从Maven的访问 [英] Password protected jenkins maven repository server - access from maven

查看:255
本文介绍了密码保护詹金斯Maven仓库服务器 - 从Maven的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经得到的詹金斯Maven资源库服务器插件。我的问题是,因为它是密码保护的,我不能从行家(内访问/插件/库/家居/回购无法转让的元数据<元>自/至<回购名称&gt (http://ci.mydomain.com/plugin/repository/everything/):访问被拒绝:<&回购GT; /<标识符GT;,ReasonPhrase:禁止

我想什么:结果
- 把在.m2目录/ settings.xml中结果的服务器凭据
- 基本认证:的http://<使用者>:<密码和GT; @ ci.mydomain.com /<&回购GT; 结果
- 无需任何权威性

无工作...

任何帮助将是AP preciated。

编辑:

我的settings.xml:

 <设置>
  <服务器和GT;
      <服务器与GT;
        <&ID GT;测试-CI< / ID>
        <用户名>&詹金斯LT; /用户名>
        <密码和GT;密码和LT; /密码>
    < /服务器>
  < /服务器>
< /设置>

和我的pom.xml

 <?XML版本=1.0编码=UTF-8&GT?;
<项目>    <&的groupId GT; com.mygroup< /的groupId>
    <&的artifactId GT;&神器LT; / artifactId的>
    <&版GT; 1.0-SNAPSHOT< /版本>
    <包装和GT;&罐子LT; /包装>    <库>
        <&库GT;
            <&ID GT;测试-CI< / ID>
            &LT; URL&GT; HTTP://ci.mydomain.com/plugin/repository/everything/< / URL&GT;
        &LT; /存储库&GT;
    &LT; /存储库&GT;    &LT;依赖和GT;
        &LT;&依赖性GT;
            &LT;&的groupId GT; com.mygroup&LT; /的groupId&GT;
            &LT;&的artifactId GT; ProjectOnCi&LT; / artifactId的&GT;
            &LT;&版GT; 1.0-SNAPSHOT&LT; /版本&GT;
            &LT;&范围GT;及提供LT; /&范围GT;
        &LT; /依赖性&GT;
    &LT; /依赖和GT;&LT; /项目&GT;


解决方案

您应该注意的詹金斯Maven资源库服务器不会作为Maven仓库进行,所以如果这是你所需要的(一个Maven回购) - 这詹金斯插件将不利于

我建议您阅读 Maven的回购;从你写的是什么,我认为,一个内部存储库(如的Nexus ,的 Artifactory的)可能是很好的。从中央Maven的默认下载JAR文件的Maven,所以你没有(也不应该)必须下载所有来源,并建立它们。

I've got a password protected jenkins server with the Jenkins Maven Repository Server plugin. My problem is, as it is password protected, i can't access the /plugin/repository/everything/ repo from within maven (Could not transfer metadata <metadata> from/to <repo-name> (http://ci.mydomain.com/plugin/repository/everything/): Access denied to: <repo>/<identifier> , ReasonPhrase:Forbidden.)

What i tried:
- Putting the server credentials in the .m2/settings.xml
- Basic auth: http://<user>:<password>@ci.mydomain.com/<repo>
- without any auth

none worked...

any help would be appreciated.

EDIT:

My settings.xml:

<settings>
  <servers>
      <server>
        <id>test-ci</id>
        <username>jenkins</username>
        <password>password</password>
    </server>
  </servers>
</settings>

and my pom.xml

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

    <groupId>com.mygroup</groupId>
    <artifactId>Artifact</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <repositories>
        <repository>
            <id>test-ci</id>
            <url>http://ci.mydomain.com/plugin/repository/everything/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.mygroup</groupId>
            <artifactId>ProjectOnCi</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>

解决方案

You should note that Jenkins Maven Repository Server will not perform as Maven Repository, so if this is what you need (a Maven repo) - this Jenkins plugin will not help.

I suggest reading about Maven Repos; from what you write I think that an internal repository (e.g. Nexus, Artifactory) might be good. Maven by default downloads JARs from Maven Central, so you do not (and should not) have to download all sources and build them.

这篇关于密码保护詹金斯Maven仓库服务器 - 从Maven的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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