Configuring spring-repo in to remote maven artifact repository. Apache - Archiva

900 Views Asked by At

I am trying to set up a remote Maven repository on my local network using Apache Archiva such that I want each and every dependency should get downloaded from the remote repository itself and not from any Externally hosted repository. For this I put the below Mirror snippet and Repository snippet in my $M2_HOME/settings.xml file:

 <mirror>
      <id>archiva.default</id>
      <url>http://192.168.x.x:xyxy/repository/internal/</url>
      <mirrorOf>*</mirrorOf>
    </mirror> 

<repositories>
  <repository>
    <id>internal</id>
    <name>Archiva Managed Internal Repository</name>
    <url>http://192.168.x.x:xyxy/repository/internal/</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
  <repository>
    <id>central</id>
    <name>Central</name>
    <url>http://repo.maven.apache.org/maven2</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </repository>
</repositories>     

Now, this configuration works just fine for almost all the dependencies present at Maven Central Repository, But fails to download dependencies from Spring Repository.

Shows the error:

Could not find artifact org.springframework.data:spring-data-Cassandra:jar:1.5.0.BUILD-SNAPSHOT in the archive.default (http://192.168.x.x:xyxy/repository/internal/)

Can someone please help me out in this? Why is this mirror snippet not mirroring Spring Repo?

1

There are 1 best solutions below

3
Praveen On

Because the central repository contains only release versions of spring-data-cassandra,

You have to include the snapshot repository like below,

<repository>
    <id>snapshots-spring</id>
    <name>Snapshots-spring</name>
    <url>https://repo.spring.io/libs-snapshot/</url>
    <releases>
      <enabled>false</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
</repository>