我已经设置了带有内部存储库的Apache Archiva
http://localhost:8080/archiva/repository/internal/
但是当我尝试运行"mvn 编译"时,对工件的请求被转发到 Apache 存档,但我看到以下错误:
无法解析的父 POM:找不到工件 org.springframework.cloud:spring-cloud-build:pom:1.2.0.BUILD-SNAPSHOT 和"parent.relativePath"点,没有本地 POM @ 第 13 行,第 10 列 -> [帮助 2]
我是否需要更新任何特定设置,以便 Archiva 可以从远程存储库获取所需的工件?
来自 ~/.m2/设置的内容.xml
<?xml version="1.0"?>
<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 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors>
<mirror>
<id>internal</id>
<name>Internal repo + cache </name>
<url>http://localhost:8080/archiva/repository/internal/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<proxies/>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>internal</id>
<name>Archiva Managed Internal Repository</name>
<url>http://localhost:8080/archiva/repository/internal/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<name>Archiva Managed Internal Repository</name>
<url>http://localhost:8080/archiva/repository/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles/>
</settings>
只要我知道 archiveiva 带有默认配置,可以在 maven 中央存储库中搜索工件。由于 maven central 不包含项目的快照版本,因此您无法从那里获取它。
尝试解决发布版本而不是快照。