簡體   English   中英

在詹金斯中使用聯系解決工件

[英]Resolve artifacts using nexus in Jenkins

我正在嘗試在運行OpenShift Origin的某些VPS上構建私有Maven工件。 我已經建立了一個本地nexus服務( http://nexus-ci.apps.intrinsic.world/content/groups/public/ ),並且已經成功(自動)使用另一個Jenkins實例來構建一些jar並將其上傳到其中。

現在,我希望這個其他單獨的Jenkins實例(因此沒有公共存儲庫)僅使用nexus查找其所有maven依賴項。 為了實現這一點,我嘗試將以下settings.xml文檔提供給Jenkins的主配置,但無濟於事:

<?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">
  <profiles>
    <profile>
      <id>nexus</id>
      <activation>
        <property>
          <name>nexus</name>
          <value/>
        </property>
      </activation>
      <repositories>
        <repository>
          <id>nexus-repository</id>
          <url>http://nexus-ci.apps.intrinsic.world/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>nexus-plugin-repository</id>
          <url>http://nexus-ci.apps.intrinsic.world/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

我想念什么?

如果您希望通過Nexus加載所有依賴項,則應使用鏡像定義而不是其他存儲庫:

<mirror>
  <id>nexus</id>
  <mirrorOf>*</mirrorOf>
  <name>Nexus</name>
  <url>http://nexus-ci.apps.intrinsic.world/content/groups/public/</url>
</mirror>

您應該使用一個組,覆蓋中央並配置鏡像。 有關示例的詳細信息,請參見文檔

另外,您可能想看看使用config-file-provider-plugin。 在Trenches視頻系列技巧中錄制了一些有關jenkins設置的視頻。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM