我已经在以下位置使用内部回购设置了Apache Archiva

http://localhost:8080/archiva/repository/internal/

但是,当我尝试运行“ mvn compile”时,对工件的请求已转发到Apache Archiva,但出现以下错误:

不可解析的父POM:在第13行第10列的本地POM上找不到工件org.springframework.cloud:spring-cloud-build:pom:1.2.0.BUILD-SNAPSHOT和'parent.relativePath'点[帮助2]

我是否需要更新任何特定设置,以便Archiva可以从远程存储库中获取所需的工件?

来自〜/ .m2 / settings.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>

最佳答案

只要我知道archiva带有默认配置,即可在Maven Central回购中搜索工件。由于maven Central不包含SNAPSHOT版本的工件,因此无法从那里获取它。

尝试解决发行版本而不是SNAPSHOT。

10-08 19:42