[英]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.