簡體   English   中英

Maven Bnd 存儲庫插件無法從遠程工件獲取工件

[英]Maven Bnd Repository Plugin fails to fetch artifact from remote artifactory

我正在嘗試使 bnd 工具結構正常工作(從教程https://bndtools.org/tutorial.html開始)

cnf/central.maven文件中添加了javax.vecmath (我能想到的簡單庫)的使用

javax.vecmath:vecmath:1.5.2

並將其添加到org.example.impl中的構建路徑,一切都解決得很好。

我在遠程服務器上運行的 jFrog 工件中有這個庫的分支,所以下一步是在cnf/build.bnd添加定義該存儲庫(如https://bnd.bndtools.org/plugins/maven.html中所述)

-plugin.10.Remote = \
    aQute.bnd.repository.maven.provider.MavenBndRepository; \
        releaseUrl=https://artifactory.website.com/artifactory/libs-release-local/; \
        snapshotUrl=https://artifactory.website.com/artifactory/libs-snapshot-local/; \
        index=${.}/release.maven; \
        name="Maven Remote"

以及cnf/release.maven中的適當參考

javax.vecmath:vecmath:2.1.5

將此庫添加到構建路徑時,我收到錯誤“2.1.5 [無法獲取 javax.vecmath:vecmath:2.1.5]”,沒有更多信息。

I figured the only difference between maven central and my artifactory should be content of .m2/settings.xml with credentials (according to https://bnd.bndtools.org/instructions/connection-settings plugin should look there in the first place) .

Configuration that works for maven in eclipse (when I open a maven project that has vecmath 2.1.5 as dependency it gets pulled without a problem to .m2/repository/javax/vecmath/vecmath/2.1.5 and once there it gets resolved just由bnd罰款)

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>username</username>
      <password>roigonsdnglosgnoisfgnsdjgnlafjksasgnl</password>
      <id>central</id>
    </server>
    <server>
      <username>username</username>
      <password>roigonsdnglosgnoisfgnsdjgnlafjksasgnl</password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>https://artifactory.website.com/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>https://artifactory.website.com/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>https://artifactory.website.com/artifactory/libs-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>https://artifactory.website.com/artifactory/libs-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

由此看來,bnd 從 maven 中央到本地 m2 存儲庫並從那里使用它似乎沒有問題,但無法連接到我的工件。 我缺少一些關鍵設置或差異嗎?

最終在https://groups.google.com/forum/#!forum/bndtools-users的幫助下解決了問題,發現我的配置存在兩個(三個?)問題。

build.bnd中存儲庫定義的正確形式似乎是

-plugin.10.Remote: \
    aQute.bnd.repository.maven.provider.MavenBndRepository; \
        releaseUrl=https://artifactory.website.com/artifactory/libs-release-local/; \
        snapshotUrl=https://artifactory.website.com/artifactory/libs-snapshot-local/; \
        index=${.}/release.maven; \
        name="Maven Remote"

查看https://bnd.bndtools.org/instructions/connection-settings服務器身份驗證配置的 bnd 不同於 maven 配置(0.3.4,由於某種原因我錯過了那部分)

<server>
  <username>username</username>
  <password>roigonsdnglosgnoisfgnsdjgnlafjksasgnl</password>
  <id>https://*website.com</id>
</server>

並且 bnd 首先在.bnd中查找連接設置,如果沒有,則在.m2中,但是如果.bnd中的設置不正確/不足,即使它包含正確/足夠的設置,它也不會在.m2中查找。

The default order in which bnd looks for settings is:
`~/.bnd/connection-settings.xml`
`~/.m2/settings.xml`

暫無
暫無

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

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