---
title: "maven 公网 setting.xml 配置（apache-maven-3.0.3）"
author: "ccfangle"
date: "2015-12-29T14:19:00Z"
tags: []
categories: ["研发管理"]
slug: "maven-setting-xml-apache-maven-3-0-3"
draft: false
lastmod: "2015-12-29T14:19:30Z"
id: 2267413
url: "https://ccfangle.iteye.com/blog/2267413"
---

公网配置项目，不是很方便，总是需要等待很长时间....

下面是我自己调试过，比较好使的数据源配置、加载方式

&lt;?xml version="1.0" encoding="UTF-8"?&gt;  
&lt;settings  
 xsi:schemaLocation="[http://maven.apache.org/SETTINGS/1.0.0](http://maven.apache.org/SETTINGS/1.0.0) [http://maven.apache.org/xsd/settings-1.0.0.xsd](http://maven.apache.org/xsd/settings-1.0.0.xsd)"  
 xmlns="[http://maven.apache.org/SETTINGS/1.0.0](http://maven.apache.org/SETTINGS/1.0.0)" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"&gt;  
 &lt;localRepository&gt;D:\\java\\repository&lt;/localRepository&gt;  
 &lt;!-- offline  
    | Determines whether maven should attempt to connect to the network when executing a build.  
    | This will have an effect on artifact downloads, artifact deployment, and others.  
    |  
    | Default: false--&gt;  
 &lt;offline&gt;true&lt;/offline&gt;  
 &lt;profiles&gt;  
  &lt;profile&gt;  
   &lt;id&gt;jdRepository&lt;/id&gt;  
   &lt;repositories&gt;  
      &lt;repository&gt;  
       &lt;id&gt;jboss-cache&lt;/id&gt;  
       &lt;name&gt;jboss-cache&lt;/name&gt;  
       &lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;  
      &lt;/repository&gt;  
      &lt;repository&gt;  
       &lt;id&gt;mvnsearch&lt;/id&gt;  
       &lt;name&gt;mvnsearch Maven Repository&lt;/name&gt;  
     &lt;url&gt;http://www.mvnsearch.org/maven2&lt;/url&gt;  
    &lt;/repository&gt;  
    &lt;repository&gt;  
     &lt;id&gt;ibiblio&lt;/id&gt;  
     &lt;name&gt;ibiblio Maven Repository&lt;/name&gt;  
     &lt;url&gt;http://www.ibiblio.org/maven2&lt;/url&gt;  
    &lt;/repository&gt;  
    &lt;repository&gt;  
     &lt;id&gt;mirrors.ibiblio&lt;/id&gt;  
     &lt;name&gt;mirrors.ibiblio Maven Repository&lt;/name&gt;  
     &lt;url&gt;http://mirrors.ibiblio.org/pub/mirrors/maven2&lt;/url&gt;  
    &lt;/repository&gt;  
    &lt;repository&gt;  
     &lt;id&gt;repo.springsource.org&lt;/id&gt;  
     &lt;name&gt;repo.springsource.org-releases&lt;/name&gt;  
     &lt;url&gt;http://repo.springsource.org/libs-milestone-local&lt;/url&gt;  
     &lt;snapshots&gt;  
      &lt;enabled&gt;false&lt;/enabled&gt;  
     &lt;/snapshots&gt;  
    &lt;/repository&gt;  
   &lt;/repositories&gt;  
   &lt;pluginRepositories&gt;  
    &lt;pluginRepository&gt;  
     &lt;id&gt;central&lt;/id&gt;  
     &lt;name&gt;Maven Plugin Repository&lt;/name&gt;  
     &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;  
     &lt;layout&gt;default&lt;/layout&gt;  
     &lt;snapshots&gt;  
      &lt;enabled&gt;false&lt;/enabled&gt;  
     &lt;/snapshots&gt;  
     &lt;releases&gt;  
      &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;  
     &lt;/releases&gt;  
    &lt;/pluginRepository&gt;  
   &lt;/pluginRepositories&gt;  
  &lt;/profile&gt;  
 &lt;/profiles&gt;  
 &lt;mirrors&gt;  
  &lt;mirror&gt;  
     &lt;id&gt;repo2&lt;/id&gt;  
     &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;  
     &lt;name&gt;Human Readable Name for this Mirror.&lt;/name&gt;  
     &lt;url&gt;http://repo2.maven.org/maven2/&lt;/url&gt;  
   &lt;/mirror&gt;  
  &lt;mirror&gt;  
     &lt;id&gt;net-cn&lt;/id&gt;  
     &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;  
     &lt;name&gt;Human Readable Name for this Mirror.&lt;/name&gt;  
     &lt;url&gt;http://maven.net.cn/content/groups/public/&lt;/url&gt;  
   &lt;/mirror&gt;  
  &lt;mirror&gt;  
     &lt;id&gt;ui&lt;/id&gt;  
     &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;  
     &lt;name&gt;Human Readable Name for this Mirror.&lt;/name&gt;  
    &lt;url&gt;http://uk.maven.org/maven2/&lt;/url&gt;  
   &lt;/mirror&gt;  
  &lt;mirror&gt;  
     &lt;id&gt;ibiblio&lt;/id&gt;  
     &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;  
     &lt;name&gt;Human Readable Name for this Mirror.&lt;/name&gt;  
    &lt;url&gt;http://mirrors.ibiblio.org/pub/mirrors/maven2/&lt;/url&gt;  
   &lt;/mirror&gt;  
  &lt;mirror&gt;  
    &lt;id&gt;jboss-public-repository-group&lt;/id&gt;  
    &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;  
    &lt;name&gt;JBoss Public Repository Group&lt;/name&gt;  
   &lt;url&gt;http://repository.jboss.org/nexus/content/groups/public&lt;/url&gt;  
  &lt;/mirror&gt;  
 &lt;/mirrors&gt;  
 &lt;activeProfiles&gt;  
  &lt;activeProfile&gt;jdRepository&lt;/activeProfile&gt;  
 &lt;/activeProfiles&gt;  
&lt;/settings&gt;