我正在尝试使用位于我们本地网络中的存储库设置 Maven,并且我已经为快照和发布设置了一个存储库(都是 apache 档案)。
从发布存储库下载包工作正常。但是,当我尝试从快照存储库加载 SNAPSHOT 版本时,当我尝试下载自己部署的 SNAPSHOT 时,我不断收到错误:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) my.company:product2:jar.lastUpdated:0.0.2-SNAPSHOT
Try downloading the file manually from the project website.
[...]
Path to dependency:
1) my.company:product1:war:0.0.1-SNAPSHOT
2) my.company:product2:jar.lastUpdated:0.0.2-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
my.company:product1:war:0.0.1-SNAPSHOT
from the specified remote repositories:
my-internal (http://my-repo:8080/archiva/repository/internal),
central (http://repo1.maven.org/maven2),
my-snapshots (http://my-repo:8080/archiva/repository/snapshots),
该软件包在快照存储库中可用,网络已启动,登录工作正常。
我的 pom.xml 看起来像这样:
[...]
<repositories>
<repository>
<id>my-snapshots</id>
<name>my name Snapshots Repository</name>
<url>http://my-snapshots:8080/archiva/repository/snapshots</url>
<snapshots>
<enabled/>
<updatePolicy/>
<checksumPolicy/>
</snapshots>
</repository>
<repository>
<id>my-internal</id>
<name>my name internal Repository</name>
<url>http://my-repo:8080/archiva/repository/internal</url>
</repository>
</repositories>
[...]
<dependency>
<groupId>my.company</groupId>
<artifactId>frontend-api</artifactId>
<version>0.0.2-SNAPSHOT</version>
<type>jar.lastUpdated</type>
</dependency>
[...]
我还检查了从快照存储库下载的 maven-metadata.xml:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>my.company</groupId>
<artifactId>product2</artifactId>
<version>0.0.2-SNAPSHOT</version>
<versioning>
<snapshot>
<buildNumber>7</buildNumber>
<timestamp>20090824.130209</timestamp>
</snapshot>
<lastUpdated>20090824130209</lastUpdated>
</versioning>
</metadata>
它显示正确的日期和时间戳(包含此时间戳的包存在于 repo 中)。
我是否遗漏了有关存储库设置或 SNAPSHOT 概念的内容?有没有人有同样的问题?或者有人知道一些关于 SNAPSHOT 和存储库的详细文档吗?