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