Eclipse输出文件夹 [英] Eclipse Output Folders

查看:425
本文介绍了Eclipse输出文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下结构,我如何才能使Eclipse正确构建WAR文件?



我需要以下文件夹才能进入以下输出文件夹:



mail / src 转换为 mail / war / WEB-INF / classes

mail / www 转换为 mail / war /

我试过在Eclipse中设置输出文件夹,不会导致任何事情,除了Eclipse会神奇地删除所有WEB-INF内容而不会告诉我!



http:/ /clausjoergensen.dk/media/files/gwt-pro-stru.png

解决方案

我通常不会使用Web应用程序项目向导创建我的GWT项目,因为我不喜欢删除所有默认的servlet和类。我通常将它们创建为动态Web项目,这将允许您将其导出为WAR。


  1. 创建一个新的动态Web项目,并根据您的项目首选项完成向导的第一步。

  2. 选择下一步>下一步,进入Web模块配置设置。

  3. 输入您的上下文根目录并将您的内容目录更改为战争,然后单击完成

这将创建一个基本Web项目,您将在此项目中启用GWT并添加基础配置。


  1. 打开您的项目属性并转到Google>Web Toolkit并选中使用Google Web Toolkit选择确定关闭此对话框。 选择文件>新建>其他以打开新的新建对话框。选择Google Web Toolkit文件夹,然后选择模块,然后选择下一步。
  2. 输入您的包裹信息和模块名称。这将在您输入的包中创建您的ModuleName.gwt.xml文件。它还会为您创建一个空的your.package.name.client。

  3. 再次选择文件>新建>其他,然后选择入口点类。在打开的向导中确认Module,Package和Source是正确的。输入入口点的名称,这通常是您的模块名称。然后选择完成

  4. 再次选择文件>新建>其他并选择HTML页面。确认路径指向战争,模块显示您的模块。输入FileName这可以是任何你想要的东西,即index.html,index.jsp,module.html

有一个完全启用GWT的动态Web项目。要正确设置运行设置,只需从菜单中选择运行并再次选择运行。然后从对话框中选择Web应用程序。


With following structure, how can I make Eclipse build the WAR file correctly?

I need following folders to go into following output folders:

mail/src into mail/war/WEB-INF/classes

mail/www into mail/war/

I have tried setting the Output folders in Eclipse, but that doesn't result in anything but Eclipse magically deleting all WEB-INF content without telling me!

http://clausjoergensen.dk/media/files/gwt-pro-stru.png

解决方案

I don't typically create my GWT projects using the "Web Application Project" wizard as I don't like having to remove all default servlets and classes. I usually create them as "Dynamic Web Projects" which will allow you to export as a WAR among other things.

  1. Create a new "Dynamic Web Project" and complete the first step of the wizard based off you project preferences.
  2. Select Next > Next to get you to the "Web Module" configuration settings.
  3. Enter your context root and change your "Content Directory" to "war" and click "Finish"

This will create you just a basic web project you will next need to enable GWT on this project and add you base configurations.

  1. Open your project Properties and goto "Google" > "Web Toolkit" and check "Use Google Web Toolkit" Select "Ok" to close this dialog box.
  2. Select "File" > "New" > "Other" to open the new "New" dialog box. Select "Google Web Toolkit" folder then select "Module" then "Next"
  3. Enter your package info and module name. This will create you your ModuleName.gwt.xml file in the package you entered. It will also create a empty your.package.name.client for you.
  4. Select "File" > "New" > "Other" again and this time select "Entry Point Class." In the wizard that opens confirm that Module, Package, and Source are correct. Enter the "Name" of the Entry point, This would typically be your module name. Then select "Finish"
  5. One more time select "File" > "New" > "Other" and select "HTML Page." Confirm that "Path" is pointing to "war" and "Modules" displays your module. Enter the "FileName" this can be anything you want i.e. index.html, index.jsp, module.html

At this point you have a Dynamic Web Project that is fully GWT enabled. To get the run setting set up properly just select "Run" from the menu and select "Run" again. Then select "Web Application" from the dialog box.

这篇关于Eclipse输出文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆