首页 > 其他分享 >eclipse中使用maven插件的有关问题:Updating index central|http://repo1.maven.org/maven2

eclipse中使用maven插件的有关问题:Updating index central|http://repo1.maven.org/maven2

时间:2023-06-27 22:02:40浏览次数:53  
标签:index 插件 central repo1 maven org Maven


eclipse中使用maven插件的问题:Updating index central|http://repo1.maven.org/maven2

问题产生如下:
因为单位使用了过滤,访问Internet时,超过10M的内容就拒绝。
因为maven插件在初始时,需要下载Maven的index文件,这个文件比较大,有38M多,下载不成功。
所以造成使用Maven添加依赖项时(Add Dependency)时,没有提示项目可用,并且在Console中,输出:
Unable to update index for central|http://repo1.maven.org/maven2 。

解决方式如下:

 

1)通过其它方式下载如下两个文件:
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.propertieshttp://repo2.maven.org.s3.amazonaws.com/.index/nexus-maven-repository-index.gz

 

2)找一个Apache Tomcat服务器,在其根目录下建立一个 /maven2/.index 的虚拟目录(注意: 如果你使用的是windows系统, 可能无法建立.index文件夹, 必须使用DOS命令:mkdir .index),把上述两个文件拷贝至该虚拟目录指向的目录下。 

3)编辑 c:\WINDOWS\system32\drivers\etc\hosts 文件,在文件中加入: 
127.0.0.1    repo1.maven.org 
注:127.0.0.1 为步骤2的Apache Tomcat服务器IP地址。 

 

 

4)在Eclipse中,打开 Maven Repositories 面板在 Global Repositories --> central 项上,点右键,Rebuild Index 即可。

 

5)移除之前在 hosts 文件中添加的内容。

 

6)(可选)把Properties中Maven项的 Download repository index updates on starup 选项去除。

标签:index,插件,central,repo1,maven,org,Maven
From: https://blog.51cto.com/nethub/6566798

相关文章

  • 阿里的Java开发规范插件验证
    阿里最近有点“烦”,但是作为技术人,更多关注的还是技术层面,其他的就交给有关机构和时间来证明。最近有项工作借鉴了阿里的Java开发规范,为了能让其落地,需要验证方案,而这个Java开发规范提供了对应的验证插件,因此从使用层面,了解一下。目前该插件实现了开发手册中的的53条规则,大部分基于......
  • maven 推送远程仓库deploy
    pom配置<distributionManagement><repository><id>maven-private</id><name>maven-private</name><url>http://ip:8081/repository/maven-private/</url></repository></distributionManagement>......
  • Spring Boot系列教程一:Eclipse安装spring-tool-suite插件
    一.前言    一直使用eclipse,个人习惯选用Eclipse+spring-tool-suite进行开发,特别注意Eclipse要选用对应的spring-tool-suite进行安装,这点笔者浪费了好长时间,以下为对应的版本。eclipse-kepler.4.3.1–>springsource-tool-suite-RELEASE-e4.3.1-updatesite.zipecl......
  • Maven构建项目后项目报Error错误Java compiler level does not match the version of
     Maven构建项目后项目报Error错误JavacompilerleveldoesnotmatchtheversionoftheinstalledJavaprojectfac 项目->右键->Properties->ProjectFacets->修改facets中Java版本(下拉箭头出)为要用的版本Maven构建项目需注意1.项目右键->Properties->buildpath->jdk2.项......
  • maven核心,pom.xml详解(转) 附录A mave的依赖范围 附录B maven常用命令集
    什么是pom?   pom作为项目对象模型。通过xml表示maven项目,使用pom.xml来实现。主要描述了项目:  -包括配置文件;  -开发者需要遵循的规则,  -缺陷管理系统,  -组织和licenses,  -项目的url,  -项目的依赖性,  -以及其他所有的项目相关因素。 快速......
  • 插件qrcode生成二维码
    1、安装依赖[email protected]、引入importQrCodefrom'qrcode'3、使用constcontent=window.location?.href||''QrCode.toDataURL(content,{margin:1,widht:128,height:1......
  • Taurus .Net Core 微服务开源框架:Admin 插件【2】 - 系统环境信息管理
    前言:继上篇:Taurus.NetCore微服务开源框架:Admin插件【1】-微服务节点管理本篇继续介绍下一个内容:1、系统环境信息节点- OS-Environment界面 基本信息如上图,重点的几个参数:1、App-StartTime:应用程序启用时间,可以在更新程序或配置文件后,查看该时间,看应用程序是否更......
  • JQ jQuery插件如何开发
    <!DOCTYPEhtml><htmllang="zh-cn"><head><metacharset="UTF-8"><title></title><scriptsrc="jquery-1.10.1.min.js"></script></head><body><script>$.extend......
  • 第30章 使用Emmet插件
    index.html<!DOCTYPEhtml><htmllang="zh-cn"><head> <metacharset="UTF-8"> <title>Document</title> <linkrel="stylesheet"href="style.css"></head><body>&......
  • gradle转maven
    背景说明前段时间接手一个项目,项目的构建用的是gradle,因为某些特殊的要求需要转内网开发,没办法,在时间不是很充裕的情况下,项目转向maven。实现方式module根目录下,build.gradle里面添加applyplugin:'java'applyplugin:'maven'添加后,右侧Gra......