maven的安装、环境配置和ideal配置

本文介绍了Maven的安装步骤,包括从官网下载、解压到指定文件夹,并验证安装是否成功。接着讲解了如何在IDEA中配置已安装的Maven,特别是设置指向Maven安装目录。针对Maven下载依赖速度慢的问题,文章提供了解决方案,即通过配置settings.xml文件使用阿里云的Maven镜像,从而大幅提升下载速度。
摘要由CSDN通过智能技术生成

Maven的安装

1.maven官网
下载maven
windows版本
2.解压到一个没有汉字的文件夹,就等于安装完成
在这里插入图片描述
3.在这里插入图片描述
4.在这里插入图片描述
5.控制台输入mvn -v
在这里插入图片描述
至此,安装完成

ideal中设置

在这里插入图片描述
注意:第三步选择的是自己解压后的maven的文件夹

下载依赖出错的尝试解决办法

https://blog.csdn.net/weixin_43691098/article/details/90307851

idea maven下载包太慢了如何解决

在pom.xml中添加maven 依赖包时,我就发现不管是否用了翻墙,下载速度都好慢,就1M的东西能下半天,很是苦恼,于是到网上搜资料,然后让我查到了。说是使用阿里的maven镜像就可以了。我于是亲自试了下,速度快的飞起!!!

操作步骤:

1、右键项目选中maven选项,然后选择“open settings.xml”或者 “create settings.xml”

2、然后把如下代码粘贴进去就可以了。重启IDE,感受速度飞起来的感觉吧!!!

<?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 at

    http://www.apache.org/licenses/LICENSE-2.0

Unless 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>
    -->
    <!-- maven自动下载的jar包,会存放到该目录下 -->
    <localRepository>D:\MavenRepository</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 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值