牛骨文教育服务平台(让学习变的简单)

在使用Maven时,有的jar包可以只在某一个仓库中有,而且只想在这个项目中使用,可以使用repositories来配置

<?xml version="1.0" encoding="UTF-8"?>
<project......

.......

<!-- 设定除中央仓库(repo1.maven.org/maven2/)外的其他仓库,按设定顺序进行查找. -->
<repositories>
   <repository>
    <id>nexus</id>
    <name>Team Nexus Repository</name>
    <url>http://localhost:8081/nexus/content/groups/public</url>
   </repository>

   <repository>
    <id>offical</id>
    <name>Maven Official Repository</name>
    <url>http://repo1.maven.org/maven2</url>
    <snapshots>
     <enabled>false</enabled>
    </snapshots>
   </repository>

......

</repositories>

即在该项目可以使用这个仓库中的JAR包,
在开发时,如果公司有私服,可能会这样使用