0

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?

SCB
  • 5,821
  • 1
  • 34
  • 43
  • Because that is in a special snapshot repo from Pivotal itself and not in maven central. You will have to configure Apache Archiva in such a way that it also checks this. – M. Deinum Jan 02 '18 at 10:02
  • Thanks for the quick response! Actually I just need to know what kind of configurations it needs so that Archiva would check for special repos..? – Amey Deshmukh Jan 02 '18 at 10:12

1 Answers1

0

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>
Praveen
  • 1,791
  • 3
  • 20
  • 33
  • Hi Praveen, I tried adding above snippet in my Settings.xml but the same error persists Failure to find org.springframework.data:spring-data-cassandra:jar:1.5.0.BUILD-SNAPSHOT in http://192.168.x.x:xyxy/repository/internal/ was cached in the local repository, resolution will not be reattempted until the update interval of archiva.default has elapsed or updates are forced -> [Help 1] – Amey Deshmukh Jan 02 '18 at 10:18
  • Can u try making a force update `mvn clean install -U` – Praveen Jan 02 '18 at 10:34
  • could you please share the part of your pom file too?. Also I could see in the error as _archive.default_ rather than _archiva.default_. Is that a typo? – Praveen Jan 02 '18 at 16:36