在MyEclipse6.0中安装m2eclipse插件

文章详细记录了从安装MyEclipse8.0到使用Maven过程中遇到的问题,包括如何解决Maven插件安装失败、创建项目时出现的依赖缺失等问题,并最终成功创建Struts2和Spring集成项目。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

     刚刚开始学习maven的时候,为了避免安装插件的麻烦(因为看maven权威指南上说在安装m2eclipse之前需要安装一系列的其他插件),就直接安装了MyEclipse8.0,它是自带maven的,可使用了一段时间后,问题就来了,在创建maven项目的时候总是报错,archetype为webapp和struts2与spring集成的项目都不能够正确的创建,很是让人郁闷— —!!怎么先天集成好的插件还这么不好用啊,因为对maven学习的还不是很深入,出现了诸多的问题也不知如何解决,还是回过头来安装插件吧!

     我先是按照maven权威指南上的安装了一遍,又一次的⊙﹏⊙b汗,有很多插件下载不来,有又有n多的错误。。。

     在http://m2eclipse.sonatype.org/installing-m2eclipse.html上介绍了具体的安装步骤,在MyEclipse中打开help——software updates——find and install中添加remote site,MyEclipse就会自动下载安装了,还算是很方便的,安装好之后,小试一下:

可以顺利创建wenapp项目O(∩_∩)O哈!

再创建一个struts2和spring集成的项目,wait...好像出错了:

***********************************

Build errors for ssh04; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project ssh04: Missing:
----------
1) com.sun:tools:jar:1.5.0

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) com.sss:ssh04:pom:pom:0.0.1-SNAPSHOT
      2) org.apache.struts:struts2-core:jar:2.0.11.2
      3) com.sun:tools:jar:1.5.0

----------
1 required artifact is missing.

for artifact:
  com.sss:ssh04:pom:0.0.1-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2, releases=true, snapshots=false)

************************************************

缺少sun的tools.jar,在出现红叉的pom.xml文件中添加:

+++++++++++++++++++++++++++++++

<!-- jdk -->
        <dependency> 
          <groupId>com.sun</groupId> 
          <artifactId>tools</artifactId> 
          <version>1.6.0</version> 
          <scope>system</scope> 
          <systemPath>D:/JDK/JDKinstall/lib/tools.jar</systemPath> 
           </dependency>

+++++++++++++++++++++++++++++++++

保存...ok,struts2项目成功创建 。(*^__^*) 嘻嘻……现在终于有些安慰了。。。

备注:不知道MyEclipse8自带的maven插件为什么在创建项目时会出错??难道是我安装的软件的问题吗?希望你也能把在学习maven的过程中积累的经验告诉我,共同学习!共同进步!↖(^ω^)↗

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值