我正在使用Maven Repository(本地存储库)来存储我自己生成的工件。
现在,在我的项目中,我想添加Snapshots版本的依赖项。
我在项目pom.xml中添加了这个来指定repo。
<repositories>
<repository>
<id>local-artifactory</id>
<url>http://172.16.3.179:8080/artifactory/libraries-test</url>
</repository>
</repositories>
这是我的依赖
<dependency>
<groupId>com.b.c</groupId>
<artifactId>cache-lib</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
SNAPHOST版本托管在repo(带时间戳)
我收到错误
Could not resolve dependencies for project : Could not find artifact com.b.c:cache-lib:jar:2.0.0-SNAPSHOT in local-artifactory (http://172.16.3.179:8080/artifactory/libraries-test) -> [Help 1]
我该如何解决这个问题?
我已将pom更新为
<repositories>
<repository>
<id>local-artifactory</id>
<url>http://172.16.3.179:8080/artifactory/libraries-${enviornment}</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>local-snap-artifactory</id>
<url>http://172.16.3.179:8080/artifactory/libraries-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
现在它正在尝试从local-snap-repo获取快照版本,但仍然是同样的错误,
错误日志:
[ERROR] Failed to execute goal on project location-service: Could not resolve dependencies for project : Could not find artifact com.b.c:cache-lib:jar:2.1.0-SNAPSHOT in local-snap-artifactory (http://172.16.3.179:8080/artifactory/libraries-snapshots) -> [Help 1]