Dave,
I don't get why you want to use the war plugin *and* in-place editing. You really want to do one or the other.


It sounds like the only 'goodness' you want from maven is the initial population of src/webapp/WEB-INF/lib (etc). You only want to go back to the war plugin to actually create a war, or run tests.

So just do that. Write a goal which has war:webapp as a prerequisite, to copy the jars back to src/webapp/WEB-INF/lib. Now run it *once*, to prepopulate your lib dir. You might as well get it to copy all the classes over too, it'll save time later.

At this point any decent IDE will not need to be told where to look for jars (so you won't bother with maven-generated ide config files), and can compile to src/webapp/WEB-INF/classes for you. Now you can just edit your webapp in your ide as per usual.

Finally, write another goal to clean up the mess by getting rid of src/webapp/WEB-INF/*.tld, src/webapp/WEB-INF/lib/*.jar and src/webapp/WEB-INF/classes/**/*.class.

You should be able to work inplace with that - the only time you'd go back to maven would be to create the war, run tests, generate tlds, update jars, etc.

Something like this would do: (untested)

  <!-- run this one each time you need to sync your inplace
       project with what maven thinks the world looks like -->
  <goal name="war:inplace"
        prereqs="war:webapp"
        description="Prepare to edit a webapp in-place">
    <ant:mkdir dir="${maven.war.src}/WEB-INF"/>
    <ant:copy todir="${maven.war.src}/WEB-INF">
      <ant:fileset dir="${maven.war.webapp.dir}/WEB-INF">
        <ant:include name="classes/**/*.class" />
        <ant:include name="lib/*.jar" />
        <!-- assumes project has no tlds of its own -->
        <ant:include name="*.tld" />
      </ant:fileset>
    </ant:copy>
  </goal>

  <!-- run this one to clean up files left around by
       war:inplace -->
  <goal name="war:inplace-clean"
        description="clean up after war:inplace">
    <ant:delete>
      <ant:fileset dir="${maven.war.src}/WEB-INF">
        <ant:include name="classes/**/*.class" />
        <ant:include name="lib/*.jar" />
        <!-- assumes project has no tlds of its own -->
        <ant:include name="*.tld" />
      </ant:fileset>
    </ant:delete>
  </goal>


Dave Ford wrote:
But what about testing : can you set an efficient unit testing environment
with "in-place" structuration?

Certainly. I have had it for years.



Which steps are necessary to run cactus tests
for example ? Do you think your developpers will go through this steps

each


time they modify code ?


No and they shouldn't - unless they are VERY patient and have time to kill.
You're over doing the whole XP thing if you think you need to run your whole
suite of tests every time you change a <td> to a <th> on a jsp page. The
point is, for micro-changes, you don't want to run your whole suite of
tests. You want instant feedback.

I'm now considering changing my directory structure and writing my own
webapp plug-in that supports in-place editing. I'm scared however. I wonder
how many (as of yet unexplored) webapp-supporting-plugins I'll break in the
process.

Dave Ford
Smart Soft - The Developer Training Company
http://www.smart-soft.com




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to