How to set-up Nexus3 to stop Maven from attempting to check for internal SNAPSHOTS from remote repository 'repository.apache.org/snapshots'

We have maven builds that use plugin “maven-antrun-plugin-1.8”. When the maven-antrun-pluglin task is executed it first checks the external apache snapshot repository " repository.apache.org/snapshots]" for internal artifacts then checks our internal nexus3 repository “repository.company.com” for the same internal artifact.

Problem occurs when the external apache repository is not available the build times out with status code “503”.

Is it possible to configure nexus to stop attempting to download internal artifacts from an external repository?

This is exactly the case why we built Routing Rules.

Alternatively, you can re-order repositories in your group repository, but that wouldn’t prevent to send requests to Apache repository if your internal repository wouldn’t have an artifact you ask for, it would just ask your internal repository first.

Hi Dawid,

Thanks you for the quick response. I was unable to find “Routing Rules” section under Repository. I have nx-all previlege. We’re on OSS 3.15.2-01. Under Repository, I see:

  • Blob Stores
  • Repositories
  • Content Selectors
  • Cleanup Policies

I believe I found the needed solution in the Nexus documents under “Configuring Apache Maven”. Once I added the mirrorOf belo to our settings.xml, ALL artifact request went through our Nexus Repository Manager.

<mirror>
  <!--This sends everything else to /public -->
  <id>nexus</id>
  <mirrorOf>*</mirrorOf>
  <url>http://localhost:8081/repository/maven-public/</url>
</mirror>

Blockquote

Thanks again.
David

Routing rules were added in 3.17

Hi Matthew,

Thanks for responding.

Regards,

David