纯手打,转载务请附上本文网址!!!

maven是很好用的,但是初次接触maven却很难弄, 首先来讲讲maven本地仓库的配置吧

首先是maven包:

http://download.csdn.net/download/xianzhixianzhixian/10234338

然后是maven本地仓库的压缩包:

http://download.csdn.net/download/xianzhixianzhixian/10234365

1、把这个压缩包解压之后放在你想放的位置,记下路径(等会用到的),我的是:C:\Program Files\Java\apache-maven-3.3.9

2、接下来是本地仓库的配置,进入电脑中你的用户目录下,我的是:C:\Users\KevinSmith。把下载的.m2压缩包直接解压到该路径中即可,settings.xml我已经配置了无需再动,如果对xml文件内容感兴趣本文末尾有

3、IDEA项目中的maven配置,你原来放置解压后的maven-3.3.9和.m2位置选进去就行,和图片里的类比

如果对xml文件内容感兴趣可以看看:

<localRepository>C:/Users/KevinSmith/.m2/repository</localRepository>中间的改成你自己本地仓库的位置,记得不要带中文

<?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.home}/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>C:/Users/KevinSmith/.m2/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.|| 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>--><!-- 阿里云仓库 -->  <mirror>  <id>alimaven</id>  <mirrorOf>central</mirrorOf>  <name>aliyun maven</name>  <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>  </mirror>  <!-- 中央仓库 -->  <mirror>  <id>repo</id>  <mirrorOf>central</mirrorOf>  <name>Human Readable Name for this Mirror.</name>  <url>http://repo1.maven.org/maven2/</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.|| 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>

maven 本地仓库配置Windows环境相关推荐

  1. Maven本地仓库配置并给idea添加配置依赖

    1.进入Maven官网下载自己需要的版本 Maven – Download Apache Maven 这个是Maven其他版本下载地址:Index of /maven (apache.org) 下载完 ...

  2. maven 本地仓库配置

    在maven 的解压目录中找到settings.xml文件 将maven 本地仓库路径加到localRepository节点下 在cmd下输入mvn help:system 如果出现如下所示,表示本地 ...

  3. Gradle 使用 Maven 本地仓库。

    Gradle 使用 Maven 本地仓库. 文章目录 Gradle 使用 Maven 本地仓库. 设置环境变量. 在 Gradle 项目中的 /build.gradle 配置文件 `repositor ...

  4. eclipse的maven配置及本地仓库配置

    eclipse的maven配置及本地仓库配置 首先去官网上下载maven的解压包到电脑上,然后解压 (下载网址为 http://maven.apache.org/download.cgi) 然后再配置 ...

  5. deepin安装配置Maven本地仓库

    第一步:下载JDK(要下载Java SE Development Kit ) 可参考之前教程 https://blog.csdn.net/qq_36986067/article/details/892 ...

  6. (三)Maven仓库介绍与本地仓库配置

    1.Maven本地仓库/远程仓库的基本介绍 示意图: 本地仓库是指存在于我们本机的仓库,在我们加入依赖时候,首先会跑到我们的本地仓库去找,如果找不到则会跑到远程仓库中去找.对于依赖的包大家可以从这个地 ...

  7. Maven阿里云与本地仓库配置

    本文来说下Maven阿里云与本地仓库配置 文章目录 阿里云中央仓库配置的原因 阿里云中央仓库配置的两种方法 pluginRepositories标签 本文小结 阿里云中央仓库配置的原因 在pom.xm ...

  8. maven本地仓库中已有jar包,项目却读取不了

    1.问题描述 前置条件:项目中有些jar包需要从私服获取,在pom.xml中配置了私服的仓库地址(通过<repository>标签). 问题1:由于在maven的配置文件(setting. ...

  9. 如何在没有联网的情况下使用maven本地仓库进行开发

    maven本地仓库.远程仓库和中央仓库的区别 本地仓库:本地的一个文件夹,用来存放所有的jar包,由自己维护: 远程仓库(或私服):由公司或单位创建的一个仓库,由公司维护: 中央仓库:互联网上的仓库, ...

最新文章

  1. java json数据输出,java服务器端输出JSON格式数据
  2. Android AES加密算法,现在实际上
  3. Java忽略算术溢出,IEEE-754:“最小”溢出条件
  4. B端产品经理思考-软硬产品设计
  5. 继 承(面向对象特征之一)
  6. html+css+js+jquery之常见的的本地存储实现一个简单的todoList项目
  7. Struts2源码阅读(五)_FilterDispatcher核心控制器
  8. 没有写入hosts文件权限
  9. Linux开机启动过程(6):页表的初始化、避开保留的内存、地址随机化
  10. 中国塑料食品和饮料包装行业市场供需与战略研究报告
  11. 把mdb文件导入SQL Server 软件的解决方法
  12. 使用python编程数学建模-Python的特点及优缺点(课程1)
  13. 思维导图MindManager:大脑思维发散和归纳的工具
  14. 自定义可自由移动的浮窗
  15. javascript网页设计期末作业 购物网站
  16. asp.net 获得根文件夹在服务器上物理路径,asp.net获取网站目录物理路径
  17. 落地SQL审核的迭代思路
  18. kindle paperwhite 使用体验
  19. OP向左,SaaS向右,如何选择?
  20. 01-Empire-Lupin-One vulnhub靶场(ssh2john)

热门文章

  1. 10分钟让你懂得基金是什么——基金不过就是这回事
  2. JB的阅读之旅-软件测试52讲(下)
  3. android plurals用法
  4. IDEA 使用技巧 -- 跳转
  5. 山东省计算机专业专科排名2015,2015山东专科学校排名及排行榜
  6. 专利费减备案操作流程——让你申请专利时的官费大大打折
  7. 科技图书翻译思想指南(上篇)
  8. 一图归纳三大种类矩阵范数:诱导范数,元素范数,Schatten范数,涵盖谱范数,2范数
  9. [附源码]计算机毕业设计右脑开发教育课程管理系统Springboot程序
  10. 我在富士康挨踢了七年(五. 激情与暴力)