Red Hat

Using Maven with JBoss Tools

Posted by Max Andersen    |    Mar 16, 2009    |    Tagged as Eclipse JBoss Tools Seam

One of the most wanted feature requests for our tooling is Maven integration/support for our projects, such as Seam.

Unfortunately we won't be able to add 'automatic' maven support in the upcoming JBoss Tools 3 release, but we have though started on doing the preparations to do so in a following release.

The biggest part of supporting Maven is that actual runtimes (i.e. Seam, Hibernate, the various specs involved etc.) is now fully mavenized and the other part is that m2eclipse have matured greatly the last few months so it is now possible to combine Eclipse WTP projects with Maven without having your head explode too often.

To illustrate how well these things work together today without any additional features from JBoss Tools Snjezana Peco made a few screencasts of how to use the examples she made available through JBoss Tools 'Project Example' functionality which are Seam projects that work with the Maven support m2eclipse offers.

Requirements:

  1. Eclipse 3.4 with JBoss Tools 3 or Developer Studio 2 (CR2 or latest release works with this)
  2. JBoss AS 4.2, EAP 4.3 or AS 5 GA (the example work with either)
  3. Seam 2.1.1 GA
  4. A recent m2eclipse, from Sonatype's updatesite

The following two screencasts Snjezana recorded shows how it works:

Screencast #1: Installing m2eclipse and get the Seam/Maven project example

  1. Snjezana starts of with showing JBoss Developer Studio 2 (you can use JBoss Tools too, just requires a bit more typing/manual configuration)
  2. Shows where Seam and AS is configured
  3. Goes to Help > Software Updates to install m2eclipse from their update site
  4. Selects Maven Integration, Doxia editor and Maven Integration for WTP under Maven Project Configurators (you can choose them all, but these are just the important ones)
  5. Wait's for the download and the install etc.
  6. When m2eclipse is installed she goes to Project Examples, types in maven and selects the Seam Booking Example - EAR mavenized - seam 2.1.21.GA
  7. Wait for the download and Maven getting all its dependencies
  8. Uses quick fix to configure the proper runtimes (i.e. jboss-seam-2.1.1.GA and JBoss 5.0 Runtime), if you had those configured from the start this step would not be needed.
  9. Wait for the project to compile
  10. Done!

Screencast #2: Using the Project Example and how to deploy/use the application.

  1. Shows again how to get the Seam booking example via Project examples
  2. Show's that the project is really a Maven project and have all the Maven features enabled
  3. Find and marks the datasource file (-ds.xml) as Deployable so the datasource will be known to JBoss
  4. Add the project to server which will deploy it
  5. Starts the server and goes to http://localhost:8080/booking/home.seam and see the Seam project runs

There you have it - nothing more to it. A mavenized Seam project where all the features of JBoss Tools is available next to all the Maven features m2eclipse brings to the plate.

Snjezana manually adjusted the pom.xml and Seam settings in tools to get this, in upcoming versions of JBoss Tools we will make sure that you can enable this automatically on new Maven/Seam projects.

Hope you like it!

Have fun! /max

back to top