使用myeclipse建立maven项目(重要)
maven是管理项目的,myeclipse是编写代码的。第一次写项目都要配置好多东西,很麻烦,now 来看看怎样新建一个maven项目。
方法/步骤
-
因为教程使用的maven是自己下载配置的,并没有使用myeclipse自带的(高版本的myeclipse自带maven)。所以首先你要安装了maven。maven的下载安装可参考下面的经验
-
打开myeclipse(本经验中使用的是myeclipse2014),Window-->preferences。
-
找到myeclipse-->maven4myeclipse,如果你要下载源码和帮助文档就勾选上图中那两个框。
-
在maven4myeclipse下找到installations,把自己安装的maven添加进来。如图:
-
找到user settings。将user settings设置为maven项目下的cfon/settings.xml,确定。
-
新建一个web工程,勾选上add maven support,java version要在1.7及以上.
-
然后一路next,到项目结构那儿,选择maven的项目结构。
-
如果幸运的话,新建的项目没有错。如果提示错误:
Failure to transfer org.apache.maven:maven-artifact:pom:2.0.6 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-artifact:pom:2.0.6 from/to central (http://repo.maven.apache.org/maven2): No connector available to access repository central (http://repo.maven.apache.org/maven2) of type default using the available factories pom.xml /hello line 1 Maven Configuration Problem
-
那样的话,打开Window-->preferences-->myeclipse-->maven4myeclipse--->user settings把local repository里面的地址复制。
如果你的myeclipse没有的话,就找到:
c:\users\{你的电脑账号}\.m2\repository (一般在这个文件夹里)。
比如我的:c:\users\long\.m2\repository
-
找打repository文件及后,在里面搜索 maven*.lastupdated。把搜出来的文件都删了。
-
重启myeclipse,右键项目--->maven4myeclipse--->update project...
-
勾选Force Update of Snapshots/Releases,然后ok退出,如果还是错误,不要着急,先等一会。如果过了一会还是有错,那就问度娘吧。如果解决了,记得投我一票哦。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决