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

  • Home
  • SEARCH
  • 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 286449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:38:14+00:00 2026-05-12T05:38:14+00:00

I am building my project with Apache Maven and have a custom repository configured

  • 0

I am building my project with Apache Maven and have a custom repository configured but when it hits the repository it just hangs for a very long time with

Downloading: http://maven.mycompany.com/m2/org/springframework/spring/2.5.6/spring-2.5.6.pom

after a few minutes it goes and downloads it from the central repo

Downloading: http://repo1.maven.org/maven2/org/springframework/spring/2.5.6/spring-2.5.6.pom
12K downloaded (spring-2.5.6.pom)

I want the timeout to be much quicker than that. This happens with all the newer versions of maven. Version 2.0.6 or earlier didn’t have this problem, it would timeout much quicker.

  • 1 1 Answer
  • 0 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-12T05:38:14+00:00Added an answer on May 12, 2026 at 5:38 am

    In versions of Maven before 2.1, there is no means to configure the client to timeout, but you can configure it to check for updates less often if you set the update policy. This partially addresses the problem.

    For example:

    <repository>
      <id>myrepo</id>
      <url>http://maven.mycompany.com/m2</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
        <updatePolicy>always</updatePolicy>
      </snapshots>
    </repository>
    

    Valid values are:

    • always – always check when Maven is started for newer versions of snapshots
    • never – never check for newer remote versions. Once off manual updates can be performed.
    • daily (default) – check on the first run of the day (local time)
    • interval:XXX – check every XXX minutes

    Another consideration is the software you are using to host your internal repository. With a repository manager such as Nexus you can manage all your external remote repository connections through the manager and configure the timeout for those remote connections. Your client will then only query the repository manager, which should respond as quickly
    as the timeouts allow.


    Update:

    If you know the dependencies aren’t going to be served by a particular repository, you can separate it into a profile, so it is not referenced in that build.

    <profiles>
      <profile>
        <id>remote</id>
        <repositories>
          <repository>
            <id>central</id>
            <url>http://repo1.maven.org</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
          </repository>
          ...
        </repositories>
      </profile>
      <profile>
        <id>internal</id>
        <repositories>
          <repository>
            <id>myrepo</id>
            <url>http://maven.mycompany.com/m2</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
          </repository>
          ...
        </repositories>
      </profile>
    </profiles>
    

    With the above config, running mvn package -Premote will not connect to the internal repository, so the timeout won’t be a factor.

    You can avoid having to specify the profiles on each build by adding some extra config to your settings:

    <settings>
      ...
      <activeProfiles>
        <activeProfile>internal</activeProfile>
        <activeProfile>remote</activeProfile>
      </activeProfiles>
      ...
    </settings>
    

    For Maven 2.1 you can set the timeout by adding a configuration on a server in the Maven settings (~/.m2/settings.xml by default), for example:

    <server>
      <id>myrepo</id>
      <configuration>
        <timeout>5000</timeout> <!-- 5 seconds -->
      </configuration>
    </server>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a maven project where I am building a war file, but I
I have a Maven project that's building fine, and I'm attempting to add a
I'm building an executable jar for a maven java project I have. It works
I'm building my project using the following POM: <project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd> <modelVersion>4.0.0</modelVersion>
Jenkins build 1.411. Building the multimodule project with maven 2 works, but using maven
I'm building my project with maven so according to maven way, config should be
I'm using qmake for building a project of mine. I have been trying to
Let's imagine I already have a project building .NET 3.5 assembly. Now I want
I have a bit of a problem building my project. I'm getting the bellow
Guys, I wanted generate the pmd report while building the project so 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.