IDEA maven上传速度很慢、解决办法

maven上传的速度很慢,排除网络原因,需要检查配置

一、项目配置

以下针对于maven仓库不在C盘的情况:

File | Settings | Build, Execution, Deployment | Build Tools | Maven

以IDEA为例,打开 File(文件)------Setting(设置)------Build, Execution, Deployment(构建、执行、部署)------Build Tools(构建工具)------ Maven

如图,默认是C盘的setting和repository,勾选后面的Override,可以重新选定路径,把自己maven的setting和repository路径选上,Apply------close即可。

setting文件可能的路径:E:\maven\apache-maven-3.8.8\conf\setting.xml。一般在解压后maven文件的conf文件下面,哪个盘看自己装哪了。

repository文件完全是自己设置的,就没有什么参考路径了。建议也是设在maven文件附近或者其他容易记住的地方。

这个步骤是每次弄新项目都要做的,除非你的maven就装在C盘,那就不用改了。

二、maven仓库配置阿里镜像

找到setting文件,把里面的内容全部替换成以下内容:

XML 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<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">
    <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>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <mirror>
            <id>uk</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://uk.maven.org/maven2/</url>
        </mirror>
 
        <mirror>
            <id>CN</id>
            <name>OSChina Central</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
        <mirror>
            <id>nexus</id>
            <name>internal nexus repository</name>
            <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
            <url>http://repo.maven.apache.org/maven2</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
 
    </mirrors>
</settings>

保存即可,一般下载maven的时候都会设置的。

三、卸了重装

前面两种方法都不行,而且速度真的很慢,只要不是网络原因,真的建议可以重装,因为重装非常快。之前下载过的东西重装以后再下载也是很快的,不用害怕重装。

四、选用其他版本的插件

下载不下来插件,又不想重装maven,如果发现自己明明有同款插件的其他版本,可以去pom.xml里面换一个maven里面已经下载过的版本,然后重载maven。但是有些项目对插件的版本是有要求的,不一定能运行。

相关推荐
程序员张32 小时前
Maven编译和打包插件
java·spring boot·maven
ybq195133454313 小时前
Redis-主从复制-分布式系统
java·数据库·redis
weixin_472339463 小时前
高效处理大体积Excel文件的Java技术方案解析
java·开发语言·excel
小毛驴8504 小时前
Linux 后台启动java jar 程序 nohup java -jar
java·linux·jar
DKPT4 小时前
Java桥接模式实现方式与测试方法
java·笔记·学习·设计模式·桥接模式
好奇的菜鸟6 小时前
如何在IntelliJ IDEA中设置数据库连接全局共享
java·数据库·intellij-idea
DuelCode7 小时前
Windows VMWare Centos Docker部署Springboot 应用实现文件上传返回文件http链接
java·spring boot·mysql·nginx·docker·centos·mybatis
优创学社27 小时前
基于springboot的社区生鲜团购系统
java·spring boot·后端
幽络源小助理7 小时前
SpringBoot基于Mysql的商业辅助决策系统设计与实现
java·vue.js·spring boot·后端·mysql·spring
猴哥源码7 小时前
基于Java+springboot 的车险理赔信息管理系统
java·spring boot