create a .war file from gwt-project

前端 未结 8 1646
渐次进展
渐次进展 2020-12-14 16:11

How do I create a .war-file from my gwt-project in eclipse?

8条回答
  •  暖寄归人
    2020-12-14 17:07

    One can also use webAppCreator to generate Ant build file.

    webAppCreator ships with GWT SDK and also with Eclipse GWT Plugin. First locate GWT plugin directory

    find $HOME/.eclipse/ -name "*gwt*sdk*"
    

    this will output GWT plugin dir path. This dir has gwt dir something like gwt-2.4.0. WebAppCreator will be in this dir. Set this dir as GWTSDK_HOME.

    export GWTSDK_HOME=/home/m/.eclipse/org.eclipse.platform_3.7.0_1364963873/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r37/gwt-2.4.0
    

    make webAppCreator executable

    chmod 755 $GWTSDK_HOME/webAppCreator
    

    Now create a project using webAppCreator in some temp dir.

    $GWTSDK_HOME/webAppCreator -out fins in.m.fins.Fins
    

    in.m.fins.Fins is the module name. This has to match with your project's gwt.xml in Eclipse workspace. If your gwt.xml is src/in/m/fins/Fins.gwt.xml then module name should be in.m.fins.Fins

    -out fins will create the project and build.xml in fins directory. Copy generated build.xml file to your project in Eclipse workspace.

    Run war target in Eclipse Ant Window to package your project as war

提交回复
热议问题