---
title: "Central Repository connection timeout"
author: "devon.k"
date: "2011-07-31T10:42:51Z"
tags: []
categories: ["编程语言"]
slug: "central-repository-connection-timeout"
draft: false
lastmod: "2011-07-31T10:42:51Z"
id: 1136558
url: "https://devon-k.iteye.com/blog/1136558"
---

执行命令

```java

mvn archetype:generate

```

 出项了中央库连接超时的错误：Connection time out. 意思就是说Maven官方的（默认的）中央库不可用了。

 找一个可用的中央库覆盖掉这个默认的，在settings.xml中加入如下mirror即可。

```xml

<mirror>
  <id>ibiblio.org</id>
  <name>ibiblio Mirror of http://repo1.maven.org/maven2</name>
  <mirrorOf>central</mirrorOf>
  <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
</mirror>

```