简体   繁体   中英

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:

  • 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.

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?

You can easily make it about one click and not unenviable. Just use ant and pattern matching. Open the ant view in Eclipse and add your file and it's just a click away.

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!). 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

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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