将现有的 Web 应用程序导入 Eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7538322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:02:23  来源:igfitidea点击:

Importing a existing Web Application , into Eclipse

eclipsejakarta-ee

提问by Pawan

I need to import a existing Web Application , into Eclipse .

我需要将现有的 Web 应用程序导入到 Eclipse 中。

Please see the Structure of my Web Application as shown in the below figure .

请参阅我的 Web 应用程序的结构,如下图所示。

http://imageshack.us/f/220/structurek.jpg/

http://imageshack.us/f/220/structurek.jpg/

From Eclipse IDE , while using import What option i need to select that is should i use

从 Eclipse IDE 中,在使用导入时我需要选择什么选项我应该使用

  1. Existing projects into Eclipse
  2. Archive File
  3. File System
  1. 将现有项目导入 Eclipse
  2. 存档文件
  3. 文件系统

please see this image http://imageshack.us/f/850/eclipseo.jpg/

请看这张图片 http://imageshack.us/f/850/eclipseo.jpg/

回答by jFrenetic

Import existing projects into Eclipseworks only for projects that were created in Eclipse.

Import existing projects into Eclipse仅适用于在 Eclipse 中创建的项目。

And you're definitely not dealing with an Archive Filehere.

而且你绝对不是在处理Archive File这里。

Import from the File Systemjust copies the resources but does not actually create an Eclipse project for you.

Import from the File System只是复制资源,但实际上并不为您创建 Eclipse 项目。

What I would advise you, is to create a new Dynamic Web Project, configuring all the required facets, and then just copy all the contents of your existing app to the WebContentfolder, either by drag'n'dropping it into the Project Exploreror by using Import from the File System, overwriting all the contents.

我建议您创建一个新的Dynamic Web Project,配置所有必需的方面,然后只需将现有应用程序的所有内容复制到WebContent文件夹中,通过将其拖放到Project Explorer或使用Import from the File System,覆盖所有内容。

So far, there seems to be no other way to do it in Eclipse. However you may check out the similar post. The user @RC recommends using ant task for this process, but I'm more than sure that it won't configure all the required facets for you. It may work for some simple Java projects, but surely not enough for Java EE projects.

到目前为止,在 Eclipse 中似乎没有其他方法可以做到这一点。但是,您可以查看类似的帖子。用户@RC 建议在此过程中使用 ant 任务,但我非常确定它不会为您配置所有必需的方面。它可能适用于一些简单的 Java 项目,但对于 Java EE 项目肯定不够。