Maven私库和本地Maven项目配置

1、项目私库服务器配置

settting 文件里面的配置
  <profiles>
     <profile>
        <id>nexusProfiles</id>
        <repositories>
            <repository>
              <id>nexus</id>
              <name>nexus Repository</name>
              <url> http://192.168.45.25:8081/nexus/content/groups/public/</url>
              <release>
                <enabled>true</enabled> <!-- 是否可以下载release的包  true为空,false为不可以,默认为false-->
              </release>
              <snapshots>
                <enabled>true</enabled> <!-- 是否下载snapshots的包 -->
              </snapshots>
            </repository>
      </repositories>
    </profile>

  </profiles>
    <!-- 只有激活之后才会生效  -->
   <activeProfiles>
      <activeProfile>nexusProfiles</activeProfile>
   </activeProfiles>


2、maven的默认中央仓库配置


apache-maven-3.2.3\lib\ maven-model-builder-3.2.3.jar  包里面的 pom-4.0.0.xml文件里,如图


3、maven中央工厂只能有私有仓库访问,需要配置镜像 mirror
 <!-- 工厂镜像,只要mirrorOf 的工厂要访问,都会自动来找镜像,
            如果镜像无法访问,就不会再去中央工厂访问
      -->
    <mirror>
      <id>nexusMirror</id>
      <mirrorOf>nexus,central</mirrorOf>  <!--  central  代表中央工厂     https://repo.maven.apache.org/maven2/    , * 表示所有的工厂-->
      <name>Human Readable Name for this Mirror.</name>
    </mirror>
   
    配置镜像之后,可以不使用  
    
<!-- 只有激活之后才会生效  -->
   <activeProfiles>
      <activeProfile>nexusProfiles</activeProfile>
   </activeProfiles>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值