在MyEclipse6.0中安装m2eclipse插件

来源:互联网 发布:淘宝招聘兼职是真的吗 编辑:程序博客网 时间:2024/06/11 10:37

     刚刚开始学习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的过程中积累的经验告诉我,共同学习!共同进步!↖(^ω^)↗

原创粉丝点击