Maven command line to exclude download from a list of remote repositories by names

275 Views Asked by At

sometimes my remote repositories are not accessible, so I would like to know if there's a Maven command line option to prevent download from a list of remote repositories by names, without modifying my settings.xml or pom.xml

I'm looking for something like: mvn clean install --exclude-remote-repositories=foo-repository,bar-repository

Notes:

  • --offline is too much, since it prevents me to access the central repository
  • I don't want to change my settings.xml or pom.xml
1

There are 1 best solutions below

0
On

The real solution is what khmarbaise suggested: Install a Nexus or Artifactory and use it to cache the remote repositories.