1.官网下载maven maven3.8.1链接

2.解压并修改conf文件夹下的setting.xml

3.配置环境变量

3.1此电脑->属性->高级系统设置->环境变量->系统变量(新建)

变量名:MAVEN_HOME
变量值:maven解压路径。如:D:\javaware\maven\apache-maven-3.8.1

3.2找到 系统变量(Path)->编辑->新建

%MAVEN_HOME%\bin

4.验证

命令窗口 mvn -v

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)

setting.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.2.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.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>--><!--本地maven仓库地址--><localRepository>D:\javaware\maven\repository</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.|确定maven在执行构建时是否应尝试连接到网络。|这将对工件下载、工件部署等产生影响。| Default: false<offline>false</offline>-->
<offline>ture</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.|    它的工作原理是这样的:POM可以声明一个用于解析某些工件的存储库。但是,此存储库有时可能会遇到流量过大的问题,因此人们已将其镜像到多个地方。| 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.|  该存储库定义将具有唯一的id,因此我们可以为该存储库创建镜像引用,用作备用下载站点。镜像站点将是该存储库的首选服务器。|--><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.|    指定要使用的存储库镜像站点,而不是给定的存储库。|  此镜像服务的存储库的ID与此镜像的mirrorOf元素匹配。ID用于继承和直接查找,并且在镜像集中必须是唯一的。<mirror><id>mirrorId</id><mirrorOf>repositoryId</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://my.repository.com/repo/path</url></mirror>--><!--使用阿里云镜像库--><mirror><id>alimaven</id><mirrorOf>central</mirrorOf><name>aliyun maven</name><url>https://maven.aliyun.com/repository/central</url></mirror></mirrors><!-- 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.| 这是一个概要文件列表,可以以多种方式激活,并且可以修改构建过程。|    在settings.xml中提供的概要文件旨在提供本地机器特定的路径和存储库位置,这些路径和位置允许构建在本地环境中工作。| 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.|  例如,如果您有一个集成测试插件(如cactus),|    它需要知道Tomcat实例的安装位置,那么您可以在这里提供一个变量,以便在构建过程中取消对该变量的引用以配置cactus插件。| 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.|   如上所述,配置文件可以通过多种方式激活。|   其中一种方法——本文档的activeProfiles部分(settings.xml)——将在后面讨论。|   另一种方法本质上依赖于系统属性的检测,或者匹配属性的特定值,或者仅仅测试其存在性。|    配置文件也可以由JDK version prefix激活,其中值为“1.4”的配置文件可能会在JDK版本“1.4.2\u 07”上执行生成时激活配置文件。|    最后,可以直接从命令行指定活动概要文件的列表。| 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.|    对于在settings.xml中定义的概要文件,您只能指定工件存储库、插件存储库和自由格式属性作为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.|  指定要使用上述一个或多个机制激活的生成过程的一组介绍。|    出于继承目的,要通过<activatedProfiles/>或命令行激活配置文件,配置文件必须具有唯一的ID。| 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.| 配置文件标识的一个受鼓励的最佳实践是对配置文件使用一致的命名约定,|       例如“env dev”、“env test”、“env production”、“user jdcasey”、“user brett”等。|  这将使您更直观地了解引入的配置文件集试图完成的任务,尤其是当您只有一个用于调试的配置文件id列表时。| 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>--><profile><repositories><repository><id>nexus</id><name>createdbymyself</name><url>http://maven.oschina.net/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>nexus</id><name>createdbymyself</name><url>http://maven.oschina.net/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></pluginRepository></pluginRepositories></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>

maven 3.8.1 安装及配置文件setting.xml相关推荐

  1. Maven配置文件(setting.xml)属性解析

    前置信息 Maven 版本:apache-maven-3.5.2 Nexus 信息:nexus2.nexus3 镜像仓库:如果仓库 X 可以提供仓库 Y 存储的所有的内容,那么仓库 X 就可以说是 仓 ...

  2. MAVEN配置文件Setting.xml学习笔记

    题记:对于maven一直是"拿来主义",但是遇到问题就有点傻逼了,今天就遇到一个maven打包的缺少插件的问题,于是整理一片学习笔记.2020.3.25 一.Setting.xml ...

  3. Maven学习—setting.xml pom.xml 配置文件详解

    一.Maven最重要的两个配置文件 Maven 仓库及相关设置配置文件 setting.xml配置文件可以设置本地仓库目录.远程仓库地址.JDK版本等等 Maven构建Java工程的pom配置文件 p ...

  4. Maven之pom.xml与setting.xml配置文件详解

    一.Maven相关问题 安装jar到本地仓库 mvn install:install-file -Dfile=jar路径 -DgroupId=组id -DartifactId=组件id -Dversi ...

  5. Maven的下载和安装【详细】

    文章目录 一.什么是Maven? 二.Maven的安装与配置 2.1下载Maven安装包 2.2配置Maven环境变量 2.3验证 三.Idea配置Maven 3.1配置 setting.xml文件 ...

  6. setting.xml的mirror、mirrorOf和pom.xml的repositories、repository的关系关联*

    为什么80%的码农都做不了架构师?>>>    一.先搞清楚mirrors,mirror,mirrorOf 简单点来说,repository就是个仓库.maven里有两种仓库,本地仓 ...

  7. Maven下载安装-配置环境变量+setting.xml配置文件的修改

    接上一篇Nexus下载安装+登录修改密码(Maven私服) 一.下载.配置环境变量 apache-maven-3.5.2-bin.zip 提取码:8hno 复制安装路径 配置MAVEN_HOME环境变 ...

  8. Maven的setting.xml配置文件详解(中文)

    <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://mav ...

  9. nexus-3.6.0-02-unix.tar.gz安装(Centos下),maven setting.xml配置案例,项目root的pom.xml配置,parent-pom的pom.xml配置案例

    1.下载nexus 进入:http://www.sonatype.org/nexus/downloads/ 说明: [OSS = Open Source Software,开源软件 – 免费] [FR ...

最新文章

  1. WPF入门(三)-几何图形之不规则图形(PathGeometry) (2)
  2. struts2 通配符简化配置
  3. MVC分页控件之二,为IQueryable定义一个扩展方法,直接反回PagedListT结果集
  4. 直播 | 华为云卢栋才:对话机器人的应用实践和最新进展
  5. 《编译原理》第三章知识点
  6. 经典C语言程序100例之五八
  7. iTOP-4412开发板实现3路ADC数模转换驱动例程
  8. 【PAT - 甲级1009】Product of Polynomials (25分)(模拟,细节)
  9. 编程在线--- 网站(IT技术学习、面试、交流)上线了
  10. 三层架构学习的困难_TCP/IP协议栈-之-三层交换技术
  11. react-native开源组件react-native-wechat学习
  12. 转: Nginx proxy讲解精华文章集
  13. Intel 内部指令 --- AVX和AVX2学习笔记
  14. vb 运行错误429 mysql_Win7运行VB工具提示“运行时错误429 ActiveX部件不能创建对象”如何解决...
  15. C语言的红外计数程序,51单片机红外计数器 电路原理图+PCB+源程序等资料分享
  16. Centos7.6安装Bugzilla5.0.4
  17. 时间(空间)复杂度 O(N) 的理解
  18. mysql 查询不等于问题
  19. C++标准库实现WAV文件读写
  20. 企业虚拟主机怎么选择

热门文章

  1. 技术丨说一说微信第三方平台的初步集成
  2. JDK之ZGC介绍.JAVAEE最新JDK剖析
  3. 可以自动采集的小说网站程序源码
  4. 饥荒计算机丢失xinput1 3.dll,【已解决】“由于找不到xinput1_3.dll,无法继续执行代码”...
  5. 高德地图使用-高亮某块区域
  6. 寒假日报(1.25)
  7. swi 指令能用在C语言吗,ARM的SWI异常中断处理程序设计
  8. 20个令人疯狂的投资事实
  9. AngularJS 精妙绝伦的控制器
  10. 有的人走了,但他的代码还闪耀着光芒