首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Maven之settings私库配备

2013-03-28 
Maven之settings私库配置?xml version1.0 encodingUTF-8?settings xmlnshttp://maven.apache.o

Maven之settings私库配置

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"           xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">  <!--设置本地仓库-->  <localRepository>F:/.m2/repository</localRepository>    <pluginGroups>  </pluginGroups>  <proxies>  </proxies>  <!--设置私库认证信息-->  <servers>  <server>    <id>nexus-releases</id>    <username>admin</username>    <password>admin123</password>  </server>  <server>    <id>nexus-snapshots</id>    <username>admin</username>    <password>admin123</password>  </server>  </servers>    <!--设置私库mirror 表示maven所有的请求都由nexus来处理-->  <mirrors><mirror><id>nexus</id><mirrorOf>*</mirrorOf><name>Nexus Mirror.</name><url>http://localhost:8081/nexus/content/groups/public</url></mirror>  </mirrors>  <!--设置maven私库信息-->  <profiles>  <profile><id>nexus</id><repositories>  <repository><id>nexus</id><name>Nexus</name><url>http://localhost:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots>  </repository></repositories><pluginRepositories>  <pluginRepository><id>nexus</id><name>Nexus</name><url>http://localhost:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots>  </pluginRepository></pluginRepositories>    </profile>    <!--覆盖maven中央仓库设置开启releases和snapshots版本的下载--><profile><id>central</id><repositories> <repository><id>central</id><url>http://central</url><releases><enabled>true</enabled></releases>    <snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>central</id><url>http://central</url><releases><enabled>true</enabled></releases>    <snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories>    </profile>  </profiles>  <!--激活私库信息的配置--><activeProfiles>    <activeProfile>nexus</activeProfile><activeProfile>central</activeProfile></activeProfiles></settings>在项目的pom文件中做如下设置<!-- nexus-releases nexus-snapshots与settings.xml中server下的id对应 --><distributionManagement><repository><id>nexus-releases</id><name>Nexus Releases Repository</name><url>http://localhost:8081/nexus/content/repositories/releases/</url></repository><snapshotRepository><id>nexus-snapshots</id><name>Nexus Snapshots Repository</name><url>http://localhost:8081/nexus/content/repositories/snapshots/</url></snapshotRepository></distributionManagement>

热点排行