工具下载
1下载jdk
2、安装eclipse到 http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigosr1
下载最新版本的jeeEclipse
3、安装maven到:
http://maven.apache.org/download.html
下载最新版本的maven
环境的配置
1、 在我的电脑属性中配置jdk的环境和maven的环境变量
2、 在eclipse中配置刚才安装好的jdk
3、 在eclipse中安装如下插件:
1、 subversion 版本控制器:http://subclipse.tigris.org/update_1.6.x
2、 m2eclipse插件 http://m2eclipse.sonatype.org/sites/m2e/
3、 m2eclipse扩展 http://m2eclipse.sonatype.org/sites/m2e-extras/
或者:http://download.jboss.org/jbosstools/updates/m2e-extensions/
选择 Maven Integration for Eclipse WTP (web项目插件)
Maven Integration for Subeclipse (svn插件)
运行项目
svn下载项目 需要如下两步:
1、配置svn建立资源库

2、配置maven项目的scm
1、选择Checkout Maven Projects from SCM

2、 填写好svn地址
注意这个地址应该是 svn://192.168.16.51/repos/trunk
Trunk目录下因为这个主干目录。
3、 点击finish之后项目就下载下来了。
常见问题:
1、 最好是将项目的文件的格式统一UTF-8或者GBK,然后在pom.xml中编译插件中加入如下内容:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> <encoding>UTF-8</encoding> </configuration> </plugin> |
m2eclipse后 可能会报Eclipse 运行使用指定的 JVM - m2eclipse 插件找不到 com.sun 的 default-tools.jar
1、在pom.xml中添加
<profiles> <profile> <id>default-tools.jar</id> <activation> <property> <name>java.vendor</name> <value>Sun Microsystems Inc.</value> </property> </activation> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.5.0_05</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </profile> </profiles> |
2、打开eclipse.ini文件添加:
-vm H:\Progra~1\Java\jdk1.7.0_04\jre\bin\javaw.exe 注意: 不能有空格,否则要用~1代替,如: ‘Program Files’ is ‘Progra~1′ jre里面的javaw.exe 一定要在:-vmargs之前 |
默认eclipse的文件编译:
为什么web项目启动的时候找不到类?
1、有可能是在pom.xml中更新某个jar包的版本,导致久版本还遗留在webapp/web-inf/lib 下面,这是一个非常常见的问题,如果升级某个子模块也可能导致久版本在lib下面出现各式各样的问题。
为什么安装maven插件报错?
选择3.7版本下载,maven插件安装的时候会依赖依赖这个插件,没有的会有错误,信息如下:
Cannot complete the install because one or more required items could not be found.
Software being installed: Maven Integration for Eclipse (Required) 0.10.0.20100209-0800 (org.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800)
Missing requirement: Maven Integration for Eclipse (Editors) 0.10.0.20100209-0800 (org.maven.ide.eclipse.editor 0.10.0.20100209-0800) requires ‘bundle org.eclipse.zest.core 0.0.0′ but it could not be found
Cannot satisfy dependency:
From: Maven Integration for Eclipse (Required) 0.10.0.20100209-0800 (org.maven.ide.eclipse.feature.feature.group 0.10.0.20100209-0800)
To: org.maven.ide.eclipse.editor [0.10.0.20100209-0800]
先安装gef插件
地址:http://download.eclipse.org/tools/gef/updates/interim/