简体   繁体   English

使用Eclipse插件清理部署程序集

[英]Cleaning Deployment Assembly with Eclipse Plugin

When faced with the unenviable task of cleaning all generated project artefacts/resources in a stock-standard Java EE/Tomcat configuration, I generally do one (or all) of 3 things: 当面对以标准股票的Java EE / Tomcat配置清理所有生成的项目工件/资源的艰巨任务时,我通常会做以下三件事之一(或全部):

  • Project/Clean 项目/清洁
  • Right-click my server, and delete any artefacts (can't remember the exact command) 右键单击我的服务器,然后删除任何人工制品(不记得确切的命令)
  • Source/Clean 来源/清洁

I'm now playing around with the Google Eclipse Plugin for Appengine, which uses an inbuilt Jetty server. 我现在正在使用适用于Appengine的Google Eclipse插件,该插件使用内置的Jetty服务器。

Firstly, the plugin doesn't have any options to clean out generated class files before redeploying (well, not that I can see anyway). 首先,该插件没有任何选项可以在重新部署之前清除生成的类文件(嗯,无论如何我还是看不到)。 And secondly, the sever is not available as a configuration option. 其次,服务器不能用作配置选项。

Are there any quick fixes available to clean all artefacts/resources in my war/WEB-INF directory? 我的war / WEB-INF目录中是否有任何快速修复方法可以清除所有伪像/资源?

You can easily make it about one click and not unenviable. 您可以轻松地实现一键点击,这并不令人羡慕。 Just use ant and pattern matching. 只需使用ant和pattern匹配即可。 Open the ant view in Eclipse and add your file and it's just a click away. 在Eclipse中打开ant视图并添加文件,只需单击即可。

Before 1.7 when app size was more limited, I used to copy almost everything out so I could upload it and serve from the blobstore (GWT permutations galore!). 在1.7之前,当应用程序大小受到更大限制时,我曾经复制了几乎所有内容,因此我可以上传它并从Blobstore提供服务(GWT排列丰富!)。 I was doing this alot!!! 我做了很多!!!

see these for details http://ant.apache.org/manual/Types/fileset.html and http://ant.apache.org/manual/Tasks/delete.html 有关详细信息,请参见这些http://ant.apache.org/manual/Types/fileset.htmlhttp://ant.apache.org/manual/Tasks/delete.html

Here's my simple code example: 这是我的简单代码示例:

<target name="moveXprojectGae">

     <delete includeemptydirs="true">
        <fileset dir="XprojectGae" includes="**/*"/>
      </delete>

    <move todir="XprojectGae">
        <fileset dir="war/XprojectGae">
            <exclude name="**.rpc"/>
            <exclude name="**nocache.js"/>
        </fileset>
    </move>

</target>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM