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.)
Select Edit Configurations under the Run menu
Click on the + button and select Maven from the list
- Name the configuration (optional)
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
General
If needed, set the Maven Home Directory to your Maven installation's location and check Override
If needed, set your Maven Local Repository
Runner
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
Open IDEA's Preferences
Select Plugins
Select the Available tab
Type Jetty Integration into the search box.
You should see the Jetty Integration plugin appear.
- Click on the "install plugin" icon.
Select OK and restart the IDE when prompted.
Create your run configuration
Select Edit Configurations under the Run menu
Click on the + button and select Jetty Server from the list
- Name the configuration (optional)
If the Application Server popup menu is empty
Click the Configure...button
Click + Add
- Select the location of your Jetty installation.
Click OK to close this sub-panel.
Configure the Server tab
Select your version of Jetty from the Application Server popup.
Configure the Deployment tab
Under Web Facets in the left, select Web
Check Deploy Web Facet "Web"
Set the Context Path to / if needed
Click Configure... to set up the web deployment source
Configure the deployment source
Start in the Web Deployment tab
Go to the Web Resource Directories section
Click New
Add app/src/main/resources at path /WEB-INF/classes
Now go to the Java EE Build Settings tab
Select Create web module exploded directory and define a directory
Select Build on frame deactivation and unselect Build web resources only. This will let you use automatic code reloading.
Click OK twice.
Finish up
Back in the Deployment tab, go to the Deployment source popup and make sure it points to your exploded directory.
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!)