Here are a few ways to use Tapestry 5, IntelliJ IDEA, and Jetty 6 together.

Tested with

Intellij IDEA 7, 8, and 9
Jetty 6

Note: Tapestry-test users need to use Jetty 5. For an alternative option see Tapestry5RunViaMain

Option 1: Building/launching via Maven

The quickest and easiest approach is to set up a run configuration using Maven (e.g. starting with the Maven archetype.)

  1. Select Edit Configurations under the Run menu

  2. Click on the + button and select Maven from the list

  3. Name the configuration (optional)
  4. Edit the three tabs as follows:
    Profile (IDEA 9) or Project(earlier versions)

    • Set Project File to your POM.xml
      Set Goals to jetty:run-exploded


    • If needed, set the Maven Home Directory to your Maven installation's location and check Override
      If needed, set your Maven Local Repository


    • Set the VM Parameters to -Djetty.scanIntervalSeconds=5 to use automatic class reloading.

You can run this normally. You can also use Maven to recompile while running -- Jetty will reload the class changes and Tapestry 5 will detect the change.

Option 2: Building/launching via IDEA

This uses the Codebrewer Jetty Integration plugin.

Install the plugin

  1. Open IDEA's Preferences

  2. Select Plugins

  3. Select the Available tab

  4. Type Jetty Integration into the search box.

  5. You should see the Jetty Integration plugin appear.

  6. Click on the "install plugin" icon.
  7. Select OK and restart the IDE when prompted.

Create your run configuration

  1. Select Edit Configurations under the Run menu

  2. Click on the + button and select Jetty Server from the list

  3. Name the configuration (optional)

If the Application Server popup menu is empty

  1. Click the Configure...button

  2. Click + Add

  3. Select the location of your Jetty installation.
  4. Click OK to close this sub-panel.

Configure the Server tab

Configure the Deployment tab

  1. Under Web Facets in the left, select Web

  2. Check Deploy Web Facet "Web"

  3. Set the Context Path to / if needed

  4. Click Configure... to set up the web deployment source

Configure the deployment source

Start in the Web Deployment tab

  1. Go to the Web Resource Directories section

  2. Click New

  3. Add app/src/main/resources at path /WEB-INF/classes

Now go to the Java EE Build Settings tab

  1. Select Create web module exploded directory and define a directory

  2. Select Build on frame deactivation and unselect Build web resources only. This will let you use automatic code reloading.

Click OK twice.

Finish up

  1. Back in the Deployment tab, go to the Deployment source popup and make sure it points to your exploded directory.

  2. Click OK

Now you can run your app normally. When you need to fix a bug, just switch to IDEA and fix it; when you switch back to your browser, IDEA will make and deploy the change for you (and Tapestry 5 will pick it up!)

Tapestry5_Run_Jetty_From_IDEA (last edited 2010-10-15 00:50:55 by adsl-75-2-138-129)