Hi

We are around 30 developers doing J2EE developement in my company.

When building with either ant or maven, a large part of the time consumed is by
generating code using various tools, such as ejbgen, xjc, wsgen etc. and the
following compilation.

To deal with this I have created a simple plugin that writes a serialized cache
to a specified location, containing any cached directories/attributes.
When performing a build, this cache is loaded and compared to the present values,
and only if changes has been applied, the defined build process starts.

Here is an example jellyscript:

<cache:load path="${maven.build.dir}/gen/xjc/build.cache">
  <cache:compare key="src" dir="${maven.src.dir}/xsd" includes="*.xsd"/>
  <cache:compare key="xjcVersion" value="${xjcVersion}"/>
  <cache:modified>
    <xjc extension="true" target="${maven.build.dir}/gen/xjc" 
         package="foo.ejb.dao.xml.webservice.events.param">
      <schema  dir="${maven.src.dir}/xsd" includes="*.xsd"/>
    </xjc>
  </cache:modified>
</cache:load>

The above shows a simple example of using the cache-plugin, only when xsd files
are changed in the defined srcdir or when the xjc-version(read from POM
dependencies) are changed, the xjc task are performed.
The cache can take any number of directories/attributes and store/compare.

This simple plugin, based on the org.apache.tools.ant.DirectoryScanner, actually
saves 2-3 minutes buildtime in my current project !

I will be happy to contribute it to the maven core-plugins, if you guys are
interested.

Regards
Brian Pedersen


Yahoo! Mail (http://dk.mail.yahoo.com) - Gratis: 6 MB lagerplads, spamfilter og 
virusscan

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

Reply via email to