Search code examples
mavenrepositorymaven-3snapshotarchiva

Cannot download "internal" SNAPSHOT artefacts from Apache archiva


I am using maven 3.0 and Apache Archiva as remote internal repository (configured as mirrior in settings.xml) but I am having problems downloading SNAPSHOT artifacts.

Failed to execute goal on project IntegrationTests: Could not resolve dependencies for project com.br.bigdata:IntegrationTests:jar:1.0-SNAPSHOT: Could not find artifact com.br.bigdata:HBaseSchema:jar:1.0-SNAPSHOT in archiva.default (.../archiva/repository/internal/) -> [Help 1]

I checked similar posts here but couldn't resolve my problem.

I checked the Archiva repository, artifact is present, correct pom versions etc. In my pom the dependency is specified:

    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>HBaseSchema</artifactId>
        <version>${version.hbaseSchema}</version>
        <scope>test</scope>
    </dependency>

The artifact pom:

<groupId>com.br.bigdata</groupId>
<artifactId>HBaseSchema</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>HBaseSchema</name>
<description>Logical HBase schema</description>

Solution

  • Sorted. This needs to be added to settings.xml

        <mirror>
      <id>archiva.snapshots</id>
      <url>http://localhost:8080/archiva/repository/snapshots</url>
      <mirrorOf>snapshots</mirrorOf>
    </mirror>
    

    and

    <profile>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <repositories>
            <repository>
              <id>internal</id>
              <name>Archiva Managed Internal Repository</name>
              <url>https://lab-insighttc: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>https://lab-insighttc:8080/archiva/repository/snapshots/</url>
              <releases>
                <enabled>false</enabled>
              </releases>
              <snapshots>
                <enabled>true</enabled>
              </snapshots>
            </repository>
        </repositories>
    </profile>