Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 643361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:16:28+00:00 2026-05-13T21:16:28+00:00

Yesterday I asked about using an exlusive maven repository, now it turns I need

  • 0

Yesterday I asked about using an exlusive maven repository, now it turns I need to use 2, they are both private .. so concerning this link which explains about forcing maven to use one repository, how do I specify the second repository? Lets take for instance I have two of these repositories in my pom.xml now, if something is missing in the two repositories it will go and search the dependency on the public repository, how to prevent this?

<repositories>
    <repository>
      <id>my-internal-site</id>
      <name>our maven repository</name>
      <url>http://myserver/repo</url>
    </repository>
 <repository>
      <id>my-other-internal-site</id>
      <name>our 2nd maven repository</name>
      <url>http://myserver/repo2</url>
    </repository>
  </repositories>

Would I need to alter the setting xml as this?

<settings>
  ...
  <mirrors>
    <mirror>
      <id>internal-repository</id>
      <name>our maven repository</name>
      <url>http://myserver/repo</url>
      <mirrorOf>my-internal-site,my-other-internal-site</mirrorOf>
    </mirror>
    <mirror>
      <id>my-other-internal-site</id>
      <name>our 2nd maven repository</name>
      <url>http://myserver/repo2</url>
      <mirrorOf>my-internal-site,my-other-internal-site</mirrorOf>
    </mirror>
  </mirrors>
  ...
</settings>

Or in some other way ?

EDIT

I know that I don’t need to set repositories in my pom.xml if I specify exclusive ones in settings.xml .. I’m just making a point so someone can answer my question better.. thank you

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:16:28+00:00Added an answer on May 13, 2026 at 9:16 pm

    You don’t need to duplicate the repository in mirrors – the configuration you illustrated would have no effect with only one of the mirrors being selected for given mirrorOf.

    Mirrors replace repositories already defined, either for a given ID or a collection of IDs (external:*, etc.). If you need to add a repository, you must add a repository element either in the POM or in the settings.

    You probably want something like this:

    <settings>
      ...
      <profiles>
        <profile>
          <id>second-repo</id>
          <repositories>
            <repository>
              <id>second-repo</id>
              <url>http://myrepo/second-repo</url>
              <!-- add releases / snapshots config as appropriate here -->
            </repository>
          </repositories>
          <!-- duplicate for pluginRepositories here if needed -->
        </profile>
      </profiles>
      <activeProfiles>
        <activeProfile>second-repo</activeProfile>
      </activeProfiles>
      ...
      <mirrors>
        <mirror>
          <id>corporate-repo</id>
          <url>http://myrepo/my-group</url>
          <mirrorOf>external:*,!second-repo</mirrorOf>
        </mirror>
      </mirrors>
      ...
    </settings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using PHP 5.x and MySQL 5.x So I asked a question yesterday about the
Yesterday I asked a question about parallel matrix multiplication in Java 7 using the
I asked a question yesterday about the USE identifier and it was answered PHP
This question follows on from a question I asked yesterday about why using the
I asked a question yesterday about using MySQL to tally results to a survey.
I already asked a question about this yesterday, but now I have another :)
I asked yesterday a question about css div positioning, now I solved my issue
Yesterday I asked about serving byte ranges from PHP. Today my question is -
Yesterday I asked this general question about decimals and their internal precisions. Here is
I asked a question about bigints yesterday which was kindly answered. However, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.