-
Notifications
You must be signed in to change notification settings - Fork 1.1k
如何在eclipse下开发
以用户apdplat为例子:
1、配置eclipse/maven/git
点击eclipse菜单栏Help > Eclipse Marketplace 搜索插件 Maven Integration for Eclipse 并点击安装即可
点击eclipse菜单栏Help > Eclipse Marketplace 搜索插件 egit 并点击安装即可
下载maven , 解压maven,编辑MAVEN_HOME/conf/settings.xml, 指定localRepository, 将MAVEN_HOME/bin加入Path环境变量
点击eclipse菜单栏Windows -> Preferences -> Maven -> Installations -> Add... -> MAVEN_HOME ,这样eclipse和控制台就用同一个maven了
在开始下面的检出步骤之前,要确认已经完成了 入门指南 里面的 步骤5-8
2、使用eclipse git插件检出项目
File > Import... > Git - Projects from Git > URI > URI: [email protected]:apdplat/APDPlat.git > Next > 输入私钥密码 > 选中master > Next > Import as general project > Finish
3、生成eclipse项目配置文件
打开命令行终端,切换到刚检出的APDPlat目录,执行
mvn eclipse:eclipse
mvn install
4、导入APDPlat_Core
File > Import... > Existing Projects into Workspace > Select root directory: APDPlat_Core目录 > 取消选中Copy projects into workspace > Finish
在项目APDPlat_Core上单击右键 > Properties > Resource > Text file encoding > Other: UTF-8
在项目APDPlat_Core上单击右键 > Build Path > Configure Build Path... > 选中Libraries选项 > Add Variable... > Configure Variables... > News... > 输入Name: M2_REPO Path:C:/Users/ysc/.m2/repository
以后如果修改了代码,可以在项目APDPlat_Core下的pom.xml上单击右键 > Run As > Maven install来使更改生效
5、导入APDPlat_Module
File > Import... > Existing Projects into Workspace > Select root directory: APDPlat_Module目录 > 取消选中Copy projects into workspace > Finish
在项目APDPlat_Module上单击右键 > Properties > Resource > Text file encoding > Other: UTF-8
以后如果修改了代码,可以在项目APDPlat_Module下的pom.xml上单击右键 > Run As > Maven install来使更改生效
6、导入APDPlat_Web
File > Import... > Existing Projects into Workspace > Select root directory: APDPlat_Web目录 > 取消选中Copy projects into workspace > Finish
在项目APDPlat_Web上单击右键 > Properties > Resource > Text file encoding > Other: UTF-8
以后如果修改了代码,可以在项目APDPlat_Web下的pom.xml上单击右键 > Run As > Maven install来使更改生效
第一次:在项目APDPlat_Web下的pom.xml上单击右键 > Run As > Maven build... > jetty:run-war
之后:在项目APDPlat_Web下的pom.xml上单击右键 > Run As > Run Configurations... > 左部Maven Build - APDPlat_Web > Run