-
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: git@github.com:apdplat/APDPlat.git -> Next -> 输入私钥密码 -> 选中master -> Next -> Import as general project -> Finish
3、生成eclipse项目配置文件
打开命令行终端,切换到刚检出的APDPlat目录,执行
cd APDPlat_Core
mvn eclipse:eclipse
cd..
cd APDPlat_Module
mvn eclipse:eclipse
cd..
cd APDPlat_Web
mvn eclipse:eclipse -Dwtpversion=1.0
cd..
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 build... -> 在Goals后面的文本框中输入:jetty:run-war -> Run (执行此步骤之后,会在 Run Configurations... -> 左部Maven Build 下创建运行配置 APDPlat_Web ,以后运行WEB SERVER则运行此配置即可)
7、Window -> Preferences -> Server -> Runtime Environments -> Add... -> Apache Tomcat v7.0 -> Next -> 输入tomcat名称、目录以及JRE(JRE要选择JDK7的安装目录)-> Finish
8、在项目APDPlat_Web上单击右键 -> Run As -> Run on Server -> 选择刚配置的tomcat -> Finish