Maven笔记|Maven配置阿里云镜像仓库

文章目录

    • 1.说明
    • 2.配置本地仓库地址
    • 3.配置阿里Maven仓库
    • 4.配置所选择镜像
    • 5.选择要激活的配置
    • 6.阿里云镜像完全配置

1.说明

2-5点为第6点的拆分说明,如果只需要配置的同学可直接跳至第6点获取完全配置即可。

2.配置本地仓库地址

<localRepository>/Volumes/mac/repositorylocalRepository>

3.配置阿里Maven仓库

<mirrors>
    <mirror>
        <id>alimavenid>
        <name>ailiyun mavenname>
        <url>http://maven.aliyun.com/nexus/content/groups/public/url>
        <mirrorOf>centralmirrorOf>
    mirror>
mirrors>

4.配置所选择镜像

<profiles>
    <profile>
        
        <id>alimavenid>
        <repositories>
            <repository>
                <id>centralid>
                <url>http://maven.aliyun.com/nexus/content/groups/public/url>
                <releases>
                    <enabled>trueenabled>
                releases>
                <snapshots>
                    <enabled>trueenabled>
                snapshots>
            repository>
        repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>centralid>
                <url>http://maven.aliyun.com/nexus/content/groups/public/url>
                <releases>
                    <enabled>trueenabled>
                releases>
                <snapshots>
                    <enabled>trueenabled>
                snapshots>
            pluginRepository>
        pluginRepositories>
    profile>
profiles>

5.选择要激活的配置

<activeProfiles>
   <activeProfile>alimavenactiveProfile>
activeProfiles>

6.阿里云镜像完全配置



<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>/Volumes/mac/repositorylocalRepository>
<mirrors>
  <mirror>
      <id>alimavenid>
      <name>ailiyun mavenname>
      <url>http://maven.aliyun.com/nexus/content/groups/public/url>
      <mirrorOf>centralmirrorOf>
  mirror>
mirrors>


<profiles>
  <profile>
      
      <id>alimavenid>
      <repositories>
          <repository>
              <id>centralid>
              <url>http://maven.aliyun.com/nexus/content/groups/public/url>
              <releases>
                  <enabled>trueenabled>
              releases>
              <snapshots>
                  <enabled>trueenabled>
              snapshots>
          repository>
      repositories>
      <pluginRepositories>
          <pluginRepository>
              <id>centralid>
              <url>http://maven.aliyun.com/nexus/content/groups/public/url>
              <releases>
                  <enabled>trueenabled>
              releases>
              <snapshots>
                  <enabled>trueenabled>
              snapshots>
          pluginRepository>
      pluginRepositories>
  profile>
profiles>
<activeProfiles>
  <activeProfile>alimavenactiveProfile>
activeProfiles>
settings>

你可能感兴趣的:(Maven配置)