Hi Martin,

On Mar 1, 2009, at 4:21 PM, Martin Grotzke wrote:

Hi,

I want to run our wicket application with the buildr jetty plugin and
want to use javarebel for reloading changed classes.

I noticed, that the buildr jetty plugin runs jetty from a tmp webapps
location like e.g.
 /tmp/Jetty_0_0_0_0_8080_mywebapp-1.0.0.war___s129z2/webapp

For javarebel I need to know/specify the location of classes that shall
be monitored for changes.

Is it possible to modify the jetty plugin so that it uses e.g.
target/classes or an exploded war in the target directory?

The jetty plugin's jetty.deploy method can directly deploy an exploded webapp from whatever directory you specify. buildr doesn't have a built-in exploded webapp task (AFAIK). Here's the one I use:

    directory(_('src/main/webapp/WEB-INF/lib'))

    task :explode => [compile, _('src/main/webapp/WEB-INF/lib')] do
      packages.detect { |pkg| pkg.to_s =~ /war$/ }.tap do |war_package|
        war_package.classes.each do |clz_src|
filter.from(clz_src).into(_('src/main/webapp/WEB-INF/ classes')).run
        end
        war_package.libs.each do |lib|
          cp lib.to_s, _('src/main/webapp/WEB-INF/lib')
        end
      end
    end

It builds an exploded war in place over the src/main/webapp directory. The value of this is that changes to static resources and JSPs are immediately picked up (without a build separate step). If you prefer, you could also write something which depends on the package step and then unpacks the war somewhere under target.

In either case, you can use the built-in jetty support to deploy like so:

  jetty.deploy "#{jetty.url}/path", _(exploded_path).to_s

Rhett

Reply via email to