将mavan仓库镜像改为阿里云镜像

找到.m2仓库中的setting.xml文件,将文件替换成下面内容即可






<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>D:\Repositories\MavenlocalRepository>

  

  

  
  <pluginGroups>
    
    <pluginGroup>org.mortbay.jettypluginGroup>
  pluginGroups>

  
  <proxies>
    
  proxies>

  
  <servers>
    

    
    <server>
        <id>releasesid>
        <username>aliusername>
        <password>alipassword>
      server>
      <server>
        <id>Snapshotsid>
        <username>aliusername>
        <password>alipassword>
      server>
  servers>

  
  <mirrors>
    
    <mirror>
      
      <id>nexusid>
      <mirrorOf>*mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/groups/public/url>
    mirror>
    <mirror>
      
      <id>nexus-public-snapshotsid>
      <mirrorOf>public-snapshotsmirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/url>
    mirror>
  mirrors>

  
  <profiles> 
    <profile>
      <id>developmentid>
      <repositories>
        <repository>
          <id>centralid>
          <url>http://centralurl>
          <releases><enabled>trueenabled><updatePolicy>alwaysupdatePolicy>releases>
          <snapshots><enabled>trueenabled><updatePolicy>alwaysupdatePolicy>snapshots>
        repository>
      repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>centralid>
          <url>http://centralurl>
          <releases><enabled>trueenabled><updatePolicy>alwaysupdatePolicy>releases>
          <snapshots><enabled>trueenabled><updatePolicy>alwaysupdatePolicy>snapshots>
        pluginRepository>
      pluginRepositories>
    profile>
    <profile>
      
      <id>public-snapshotsid>
      <repositories>
        <repository>
          <id>public-snapshotsid>
          <url>http://public-snapshotsurl>
          <releases><enabled>falseenabled>releases>
          <snapshots><enabled>trueenabled><updatePolicy>alwaysupdatePolicy>snapshots>
        repository>
      repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>public-snapshotsid>
          <url>http://public-snapshotsurl>
          <releases><enabled>falseenabled>releases>
          <snapshots><enabled>trueenabled><updatePolicy>alwaysupdatePolicy>snapshots>
        pluginRepository>
      pluginRepositories>
    profile>
  profiles>

   <activeProfiles>
    <activeProfile>developmentactiveProfile>
    <activeProfile>public-snapshotsactiveProfile>
   activeProfiles>
settings>

你可能感兴趣的:(Java)