5.修改本地库

一、修改配置文件

1.1找到配置文件并进行修改

1.2修改远程镜像仓库的地址(此处我用的是阿里云的,注意行号,便于快速找到)

 <!-- 配置镜像仓库 --><mirror><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf>        </mirror>

1.3修改本地仓库的路径

1.4完整的settings.xml文件:以备不时之需

<?xml version="1.0" encoding="UTF-8"?><!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
--><!--| This is the configuration file for Maven. It can be specified at two levels:||  1. User Level. This settings.xml file provides configuration for a single user,|                 and is normally provided in ${user.home}/.m2/settings.xml.||                 NOTE: This location can be overridden with the CLI option:||                 -s /path/to/user/settings.xml||  2. Global Level. This settings.xml file provides configuration for all Maven|                 users on a machine (assuming they're all using the same Maven|                 installation). It's normally provided in|                 ${maven.conf}/settings.xml.||                 NOTE: This location can be overridden with the CLI option:||                 -gs /path/to/global/settings.xml|| The sections in this sample file are intended to give you a running start at| getting the most out of your Maven installation. Where appropriate, the default| values (values used when the setting is not specified) are provided.||-->
<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| The path to the local repository maven will use to store artifacts.|| Default: ${user.home}/.m2/repository<localRepository>/path/to/local/repo</localRepository>--><!-- 配置本地仓库的路径 --><localRepository>E:/Java/repo</localRepository><!-- interactiveMode| This will determine whether maven prompts you when it needs input. If set to false,| maven will use a sensible default value, perhaps based on some other setting, for| the parameter in question.|| Default: true<interactiveMode>true</interactiveMode>--><!-- offline| Determines whether maven should attempt to connect to the network when executing a build.| This will have an effect on artifact downloads, artifact deployment, and others.|| Default: false<offline>false</offline>--><!-- pluginGroups| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.|--><pluginGroups><!-- pluginGroup| Specifies a further group identifier to use for plugin lookup.<pluginGroup>com.your.plugins</pluginGroup>--></pluginGroups><!-- proxies| This is a list of proxies which can be used on this machine to connect to the network.| Unless otherwise specified (by system property or command-line switch), the first proxy| specification in this list marked as active will be used.|--><proxies><!-- proxy| Specification for one proxy, to be used in connecting to the network.|<proxy><id>optional</id><active>true</active><protocol>http</protocol><username>proxyuser</username><password>proxypass</password><host>proxy.host.net</host><port>80</port><nonProxyHosts>local.net|some.host.com</nonProxyHosts></proxy>--></proxies><!-- servers| This is a list of authentication profiles, keyed by the server-id used within the system.| Authentication profiles can be used whenever maven must make a connection to a remote server.|--><servers><!-- server| Specifies the authentication information to use when connecting to a particular server, identified by| a unique name within the system (referred to by the 'id' attribute below).|| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are|       used together.|<server><id>deploymentRepo</id><username>repouser</username><password>repopwd</password></server>--><!-- Another sample, using keys to authenticate.<server><id>siteServer</id><privateKey>/path/to/private/key</privateKey><passphrase>optional; leave empty if not used.</passphrase></server>--></servers><!-- mirrors| This is a list of mirrors to be used in downloading artifacts from remote repositories.|| It works like this: a POM may declare a repository to use in resolving certain artifacts.| However, this repository may have problems with heavy traffic at times, so people have mirrored| it to several places.|| That repository definition will have a unique id, so we can create a mirror reference for that| repository, to be used as an alternate download site. The mirror site will be the preferred| server for that repository.|--><mirrors><!-- mirror| Specifies a repository mirror site to use instead of a given repository. The repository that| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.|<mirror><id>mirrorId</id><mirrorOf>repositoryId</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://my.repository.com/repo/path</url></mirror>--></mirrors><!-- 配置镜像仓库 --><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf>        </mirror><!-- profiles| This is a list of profiles which can be activated in a variety of ways, and which can modify| the build process. Profiles provided in the settings.xml are intended to provide local machine-| specific paths and repository locations which allow the build to work in the local environment.|| For example, if you have an integration testing plugin - like cactus - that needs to know where| your Tomcat instance is installed, you can provide a variable here such that the variable is| dereferenced during the build process to configure the cactus plugin.|| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles| section of this document (settings.xml) - will be discussed later. Another way essentially| relies on the detection of a system property, either matching a particular value for the property,| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.| Finally, the list of active profiles can be specified directly from the command line.|| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact|       repositories, plugin repositories, and free-form properties to be used as configuration|       variables for plugins in the POM.||--><profiles><!-- profile| Specifies a set of introductions to the build process, to be activated using one or more of the| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>| or the command line, profiles have to have an ID that is unique.|| An encouraged best practice for profile identification is to use a consistent naming convention| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.| This will make it more intuitive to understand what the set of introduced profiles is attempting| to accomplish, particularly when you only have a list of profile id's for debug.|| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.<profile><id>jdk-1.4</id><activation><jdk>1.4</jdk></activation><repositories><repository><id>jdk14</id><name>Repository for JDK 1.4 builds</name><url>http://www.myhost.com/maven/jdk14</url><layout>default</layout><snapshotPolicy>always</snapshotPolicy></repository></repositories></profile>--><!--| Here is another profile, activated by the system property 'target-env' with a value of 'dev',| which provides a specific path to the Tomcat instance. To use this, your plugin configuration| might hypothetically look like:|| ...| <plugin>|   <groupId>org.myco.myplugins</groupId>|   <artifactId>myplugin</artifactId>||   <configuration>|     <tomcatLocation>${tomcatPath}</tomcatLocation>|   </configuration>| </plugin>| ...|| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to|       anything, you could just leave off the <value/> inside the activation-property.|<profile><id>env-dev</id><activation><property><name>target-env</name><value>dev</value></property></activation><properties><tomcatPath>/path/to/tomcat/instance</tomcatPath></properties></profile>--></profiles><!-- activeProfiles| List of profiles that are active for all builds.|<activeProfiles><activeProfile>alwaysActiveProfile</activeProfile><activeProfile>anotherAlwaysActiveProfile</activeProfile></activeProfiles>-->
</settings>

转载于:https://www.cnblogs.com/Nick-Hu/p/7287426.html

5.修改本地库/远程仓库的地址相关推荐

  1. git修改本地和远程仓库名称的解决方法

    git修改本地和远程仓库名称的解决方法 参考文章: (1)git修改本地和远程仓库名称的解决方法 (2)https://www.cnblogs.com/zlting/p/9620259.html 备忘 ...

  2. 修改git的远程仓库命令

    1. 修改命令 git remte origin set-url URL 2.先删后加 git remote rm origin git remote add origin git@github.co ...

  3. 如何快速关联/ 修改 Git 远程仓库地址

    如何快速关联/ 修改 Git 远程仓库地址 昨天,新公司乔迁之喜,搬到了一栋宽阔而舒适新办公楼,所有的办公设备和固定资产一并迁移,这样,代码服务器的 IP就发生了变更,从而用于代码版本控制的本地Git ...

  4. 前端VSCode修改Git远程仓库地址链接

    https://blog.csdn.net/weixin_42870215/article/details/111470606 vscode中修改/重置gitlab远程仓库地址 一.更换git远程仓库 ...

  5. Maven 系列 2:Maven 本地仓库与远程仓库配置完整步骤以及修改 settings.xml 后的完整内容(配置非私服,远程仓储镜像强力推荐阿里云)

    文章目录 前言 一.Maven 三大仓库说明 1.1.本地仓库 1.2.远程仓库(私库.镜像仓库) 1.3.Maven 中央仓库 1.4.三大仓库的检索顺序 二.Maven 管理项目的生命周期 三.本 ...

  6. git 删除文件 、只删除远程仓库文件、更换远程仓库

    一.删除文件 1.克隆远程仓库到本地库. 例如使用ssh方法: git clone git@github.com:xxx/xxx.git 2.对需要删除的文件.文件夹进行如下操作: git rm te ...

  7. Git 之五 通信协议(HTTPS、SSH、Git)、使用远程仓库(GitHub、GitLab、Gitee等)

    写在前面   Git 的官网上有很详细的使用教程(当然有翻译版本),具体地址是 https://git-scm.com/book/zh/v2.唯一不足就是,很多讲解并没有实机演示.但是,毫无疑问,官网 ...

  8. 用git提交代码到远程仓库遇到的问题

    目录 我的学习过程 git环境配置(Mac版) git原理图 git的push操作思路 遇到的问题 我的学习过程 昨天重写了一遍聊天程序,准备提交到git上进行代码管理.结果遇到了不少问题.我照着网上 ...

  9. git remote(远程仓库操作)

    1.列出所有远程仓库名,只显示name git remote # 列出远程仓库name origin 2.列出所有远程仓库详细信息 git remote -v # 列出远程仓库的详细信息 origin ...

最新文章

  1. 架构 | 聊聊我心中的架构设计观
  2. P3244-[HNOI2015]落忆枫音【dp】
  3. Mono Compatibility
  4. 求字符串全排列的递归算法
  5. ajax异步提交 java_jquery ajax异步上传
  6. 46 - 算法 -Leetcode 168 -位运算 类型模拟倒序利用vector
  7. php+ajax+打开新页面跳转,ajax怎样跳转到新的jsp页面(附代码)
  8. 如何到top5%?NLP文本分类和情感分析竞赛总结
  9. python生成公共包(SDK)
  10. w3690 支持服务器内存,微星S20内存是什么
  11. pandas.plotting.scatter_matrix 参数
  12. 18年ACM赛后总结
  13. redis的雪崩和穿透
  14. 计算机室内设计绘图论文,室内装饰设计论文参考文献范例借鉴
  15. LeetCode 605[Python]. 种花问题 假设你有一个很长的花坛,一部分地块种植了花,另一部分却没有。可是,花卉不能种植在相邻的地块上,它们会争夺水源,两者都会死去。
  16. LINUX去掉“哔哔叫”的方法
  17. CopyWebpackPlugin的ignore
  18. Kafka常见故障分析总结
  19. 下载神器-IDM使用教程及下载
  20. 【味觉模拟】重口味人士福利“智能咸味勺子”

热门文章

  1. 宿松的小孤山在安徽省内有名吗?
  2. 话说P2P理财纷纷暴雷之后,那些投资者的钱去了哪里?
  3. 当下的互联网时代,“急功近利”不是坏事
  4. 互联网行业哪个职位比较有前途?
  5. go使用cli实现命令行多指令操作
  6. MyBatis使用log4j输出日志
  7. 用信号量实现进程互斥、同步、前驱关系
  8. 解决“/dev/mapper/centos-root 100%”满了
  9. 华为手机使用应用沙盒动态修改分辨率参数
  10. HttpRunnerManager(一)--安装