maven配置仓库+远程maven中央库


  1 <?xml version="1.0" encoding="UTF-8"?>
  2 
  3 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  5 
  6   <localRepository>D:/maven/repository</localRepository>
  7 
  8   <offline>false</offline>
  9 
 10   <pluginGroups>
 11   </pluginGroups>
 12 
 13   <proxies>
 14     <!--代理元素包含配置代理时需要的信息 -->
 15     <proxy>
 16       <!--代理的唯一定义符,用来区分不同的代理元素。 -->
 17       <id>myproxy</id>
 18       <!--该代理是否是激活的那个。true则激活代理。当我们声明了一组代理,而某个时候只需要激活一个代理的时候,该元素就可以派上用处。 -->
 19       <active>true</active>
 20       <!--代理的协议。 协议://主机名:端口,分隔成离散的元素以方便配置。 -->
 21       <protocol>http</protocol>
 22       <!--代理的主机名。协议://主机名:端口,分隔成离散的元素以方便配置。 -->
 23       <host>qjsbsz-d0051</host>
 24       <!--代理的端口。协议://主机名:端口,分隔成离散的元素以方便配置。 -->
 25       <port>8080</port>
 26       <!--代理的用户名,用户名和密码表示代理服务器认证的登录名和密码。 -->
 27       <username></username>
 28       <!--代理的密码,用户名和密码表示代理服务器认证的登录名和密码。 -->
 29       <password></password>
 30       <!--不该被代理的主机名列表。该列表的分隔符由代理服务器指定;例子中使用了竖线分隔符,使用逗号分隔也很常见。 -->
 31       <nonProxyHosts></nonProxyHosts>
 32     </proxy>
 33   </proxies>
 34 
 35   <servers>
 36     <server>
 37       <id>releases</id>
 38       <username>admin</username>
 39       <password>admin123</password>
 40     </server>
 41     <server>
 42       <id>snapshots</id>
 43       <username>admin</username>
 44       <password>admin123</password>
 45     </server>
 46   </servers>
 47 
 48   <mirrors>
 49     <mirror>
 50       <id>alimaven</id>
 51       <name>aliyun maven</name>
 52       <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
 53       <mirrorOf>central</mirrorOf>
 54     </mirror>
 55     <mirror>
 56       <id>repo.maven.apache.org</id>
 57       <mirrorOf>central</mirrorOf>
 58       <name>repo.maven.apache.org</name>
 59       <url>http://repo.maven.apache.org/maven2</url>
 60     </mirror>
 61     <mirror>
 62       <id>nexus</id>
 63       <mirrorOf>*</mirrorOf>
 64       <name>Mirror</name>
 65       <url>http://10.20.21.99:8081/nexus/content/groups/public/</url>
 66     </mirror>
 67   </mirrors>
 68 
 69   <profiles>
 70     <profile>
 71       <id>alimaven</id>
 72       <activation>
 73         <activeByDefault>true</activeByDefault>
 74       </activation>
 75       <repositories>
 76         <repository>
 77           <id>alimaven</id>
 78           <name>aliyun maven</name>
 79           <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
 80           <layout>default</layout>
 81         </repository>
 82         <repository>
 83           <id>alimaven</id>
 84           <name>aliyun maven</name>
 85           <url>http://maven.aliyun.com/nexus/content/repositories/public/</url>
 86           <layout>default</layout>
 87         </repository>
 88       </repositories>
 89       <pluginRepositories>
 90         <pluginRepository>
 91           <id>alimaven</id>
 92           <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
 93         </pluginRepository>
 94       </pluginRepositories>
 95     </profile>
 96 
 97     <profile>
 98       <id>repo.maven.apache.org</id>
 99       <activation>
100         <activeByDefault>true</activeByDefault>
101       </activation>
102       <repositories>
103         <repository>
104           <id>central</id>
105           <name>Central Repository</name>
106           <url>http://repo.maven.apache.org/maven2</url>
107           <layout>default</layout>
108           <!-- <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> <checksumPolicy>always</checksumPolicy> </snapshots> -->
109         </repository>
110       </repositories>
111       <pluginRepositories>
112         <pluginRepository>
113           <id>repo.maven.apache.org</id>
114           <url>http://repo1.maven.org/maven2/</url>
115         </pluginRepository>
116       </pluginRepositories>
117     </profile>
118 
119     <profile>
120       <id>nexus</id>
121       <activation>
122         <activeByDefault>true</activeByDefault>
123         <jdk>1.7</jdk>
124       </activation>
125       <properties>
126         <maven.compiler.source>1.7</maven.compiler.source>
127         <maven.compiler.target>1.7</maven.compiler.target>
128         <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
129       </properties>
130       <repositories>
131         <repository>
132           <id>nexus</id>
133           <name>local private nexus</name>
134           <url>http://10.20.21.99:8081/nexus/content/groups/public</url>
135           <releases>
136             <enabled>true</enabled>
137           </releases>
138           <snapshots>
139             <enabled>false</enabled>
140           </snapshots>
141         </repository>
142         <repository>
143           <id>nexus_snap</id>
144           <name>local private nexus</name>
145           <url>http://10.20.21.99:8081/nexus/content/repositories/snapshots</url>
146           <releases>
147             <enabled>false</enabled>
148           </releases>
149           <snapshots>
150             <enabled>true</enabled>
151           </snapshots>
152         </repository>
153         <repository>
154           <id>com.springsource.repository.maven.release</id>
155           <url>http://maven.springframework.org/release/</url>
156           <releases>
157             <enabled>true</enabled>
158           </releases>
159           <snapshots>
160             <enabled>false</enabled>
161           </snapshots>
162         </repository>
163       </repositories>
164       <pluginRepositories>
165         <pluginRepository>
166           <id>nexus_release</id>
167           <name>local private nexus</name>
168           <url>http://10.20.21.99:8081/nexus/content/groups/public</url>
169           <releases>
170             <enabled>true</enabled>
171           </releases>
172           <snapshots>
173             <enabled>true</enabled>
174           </snapshots>
175         </pluginRepository>
176       </pluginRepositories>
177     </profile>
178   </profiles>
179 
180   <activeProfiles>
181     <activeProfile>nexus</activeProfile>
182   </activeProfiles>
183 </settings>
View Code

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM