向idea中导入myeclipse中的web项目

向idea中导入myeclipse中的web项目

 

一、idea导入web项目

1、点击Import Project,如果你已创建了一个idea项目,在File中点击close project,就可来到此页面。

 

 向idea中导入myeclipse中的web项目

2、选择web项目所在路径,点击OK:

向idea中导入myeclipse中的web项目

3、选中import project from external model,选择Eclipse,点击next,一直next到最后:

向idea中导入myeclipse中的web项目

4、点击左上角File->Project Structure或者直接点击工具栏上的图标, 或者使用工具栏的快捷键 (ctrl + shift + Alt + s) :

向idea中导入myeclipse中的web项目

5、在Project中选择jdk:

向idea中导入myeclipse中的web项目

6、在Modules项的Sources标签页中配置项目结构:

向idea中导入myeclipse中的web项目

7、在path中配置编译后文件输出路径,选择“Use module compile out path” -> 将Outputpath 和Test output path 都设置为classes文件夹:

向idea中导入myeclipse中的web项目

8、因为在导入项目的时候选择了导入的是eclipse项目,所以此处依赖关系已自动处理,只需手动配置主要是要加上jdk和web-inf/lib的jar包。图片中标示的项目名称下有红色波浪线的错误提示,把依赖关系中所有红色的项删掉即可),将Module SDK选择为你的jdk版本,点击右边的 + 号 -> 选择 “1 JARS or directories ...”

向idea中导入myeclipse中的web项目

-> 选择lib文件夹 -> OK

向idea中导入myeclipse中的web项目

9、点击Facets项->点击+号->添加Web模块:

向idea中导入myeclipse中的web项目

选择你的项目->OK

向idea中导入myeclipse中的web项目

10、点击Web Resource Directory下的路径对Web Resource进行修改。idea默认的目录是web,web项目是WebRoot

向idea中导入myeclipse中的web项目

11、->Artifacts->+号->WebApplication:Exploded->From Modules..

向idea中导入myeclipse中的web项目

选择自己的项目

向idea中导入myeclipse中的web项目

使用默认设置即可->Apply->ok

向idea中导入myeclipse中的web项目

二、配置Tomcat容器

1、在菜单栏中Run -> Edit Configurations...

向idea中导入myeclipse中的web项目

2、->+号->Tomcat Server->选择Local

向idea中导入myeclipse中的web项目

3、在name中输入服务器名称,点击 "Application Server" 后面的 "Configure...",在弹出的Application Servers窗口Tomcat Home 下选择本地安装的tomcat目录 -> OK

向idea中导入myeclipse中的web项目

4、在“Server”面板中,不勾选“After Launch”,设置“HTTP port”和“JMX port”(默认值即可),点击Apply -> OK,(左边列表中tomcat图标上小红叉是未部署项目的提示,部署项目后就会消失)。

向idea中导入myeclipse中的web项目

 

三、在tomcat上部署并运行项目

1、菜单栏:Run -> Edit Configurations... (或者通过工具栏)->选择刚创建的tomcat7 -> 选择Deployment ->点击右边的“ + ”号 -> 选择 Artifact

向idea中导入myeclipse中的web项目

向idea中导入myeclipse中的web项目

向idea中导入myeclipse中的web项目

 

 

2、在Server面板,将On 'update' action和On frame deactivation(这两个选项是tomcat配置了项目后才有的)改为update classes and resources -> Apply

向idea中导入myeclipse中的web项目

 

3、运行Tomcat