解决MyEclipse的Unable to update index for central|http://repo1.maven.org/maven2问题
maven
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
项目地址:https://gitcode.com/gh_mirrors/ma/maven
·
今天初次接触maven,就是在MyEclipse中建立maven工程,但是在建立好以后,就出现了这个问题:Unable to update index for central|http://repo1.maven.org/maven2。找了很多的资料,最终解决了,具体的方法如下:
第一步:
打开Window => Preferences => Myeclipse => Maven4Myeclipse >==Maven:会看到右边显示Maven的一些信息,选中第一个Offline,禁用Download repository index updates on startup。
第二步:
自已架设or找个镜像站连上去 ,修改settings.xml内容,加上如下代码:
<mirror>
<id>UK</id>
<name>UK Central</name>
<url>http://uk.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
至于在哪里找到settings.xml,对于我来讲,我使用的是MyEclipse8.6,然后maven使用的是3.0.5,下载好maven3.0.5之后,自己配置环境变量,然后在配置到MyEclipse中,(至于如何配置的问题,百度一下,就可以找到,和配置java的jdk很相似)我的maven安装在D:\EditSoft\apache-maven-3.0.5,所以,直接在这个目录下找到\conf,里面就是settings.xml文件了,打开以后(注意:使用编辑的方式打开),找到<mirror> </mirror>将上述代码(<mirror> </mirror>标记之间的)复制进去,重启MyEclipse,就ok啦。
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
最近提交(Master分支:2 个月前 )
74ef1276
Maven 4.x introduces a unified <sources> element that supports modular
project layouts (src/<module>/<scope>/<lang>). However, resource handling
did not follow the modular layout - resources were always loaded from
the legacy <resources> element which defaults to src/main/resources.
This change implements automatic module-aware resource injection:
- Detect modular projects (projects with at least one module in sources)
- For modular projects without resource configuration in <sources>,
automatically inject resource roots following the modular layout:
src/<module>/main/resources and src/<module>/test/resources
- Resources configured via <sources> take priority over legacy <resources>
- Issue warnings (as ModelProblem) when explicit legacy resources are ignored
Example: A project with modular sources for org.foo.moduleA will now
automatically pick up resources from:
- src/org.foo.moduleA/main/resources
- src/org.foo.moduleA/test/resources
This eliminates the need for explicit maven-resources-plugin executions
when using modular project layouts. 1 天前
03809994
1 天前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)