Getting started with JBoss Seam and Maven

For the past couple of weeks I’ve been doing a bit of early development work with Seam, it’s been fun but not without annoyance.

The project is green field which in one respect is quite nice because of the freedom it presents with regards to technology and architecture choices, but on the flip side you’ve actually got to investigate these choices and do all the general project plumbing (build management, etc.).

This initial post will deal largely with a couple of build infrastructure issues and solutions.

1. Maven

Fortunately the Seam Framework guys have been publishing Maven artifacts for awhile now.

Unfortunately, information on suitable project archetypes to use has been scarce. Initial searches turned up a few examples that were a number of years old and quite dated.

I eventually found JBSEAM-2371 which provided a useful starting point project.

I had to download the parent Seam pom and make modifications to the artifact name in order to get mvn site-deploy working appropriately. Something about the site plugin not being able to create directories with spaces in them.

Current Status: Everything is working. SeamTest-based integration tests are working (using embedded-jboss and hsqldb). Both the Maven site and IntelliJ IDEA plugins create the appropriate output. Artifacts are being deployed into JBoss 4.2.2.GA as part of the install phase using cargo.

The project layout is somewhat like the following:

api/app1-api
api/app2-api
seam/app1/app1-web
seam/app1/app1-ejb
seam/app1/app1-ear
seam/app2/app2-web
seam/app2/app2-ejb
seam/app2/app2-ear     

2. Static Analysis

Nothing too out of the ordinary here.

I’ve currently setup Checkstyle and FindBugs.

Configuration is stored in a separate top-level build-resources artifact (with xml configurations stored in src/main/resources) and included as a build extension in the project pom.

<build>
...
  <extensions>
    <extension>
      <groupId>a.b.c</groupId>
      <artifactId>build-resources</artifactId>
      <version>1.0-SNAPSHOT</version>
    </extension>
  </extensions>
</build>

3. API Development

One of the key components of this project will be an API.

Rather than go the SOAP web services route, we’re strongly considering going RESTful with JAX-RS/JSR 311 helping us get there.

Bill Burke, Angry Bill of JBoss fame, has been actively developing RESTeasy, an implementation of JSR 311. It integrates fairly nicely with a Seam deployment (annotate your stateless EJBs and modify your web.xml) and allows you to easily expose a RESTful API backed by stateless session beans.

It should also be possible to go with the reference implementation of the JSR 311, Jersey, although I suspect that the JBoss implementation will eventually have a nicer integration for users of their stack.

JBoss AS doesn’t currently ship with a JSR 311 implementation so I had to install the jax-rs API and resteasy implementation jars into server/default/lib as part of a separate bootstrap process. This allowed me to mark the dependencies as provided.

Conclusion

Things are working and most of the grunt project infrastructure work is behind me. It’s been a good opportunity to get more familiar with Maven but now it’s time to get cracking on requirements definition and prototyping!

If you’re interested in working on a Seam-based application in the BioIT/Data management space, leave a comment and we’ll be in touch.

Twitter + Me

I’m been sufficiently busy at work since getting back from San Francisco and haven’t had much opportunity to blog.

As part of the JavaOne experience, I’ve taken another look at Twitter and have been using it as a quasi micro-publishing platform. It’s somewhat entertaining and the barrier to tweet is sufficiently lower.

@ajordens

Nothing too exciting and I hope to get back into the blogging train of thought shortly. I’ve got plenty to talk about from some recent experiences in the land of Seam (JPA, Facelets, etc.) and Maven.

We’re Hiring : Java Geniuses, Lets Talk.

GenoLogics is looking for talented Java Geniuses (or software developers) to help us advance the Life Sciences industry’s leading Data Management platform. This is an opportunity to become part of a bright, talented team and develop a world-class product. To excel in this position, you must be passionate about software development. You must enjoy working with other brilliant developers and you cannot be afraid to speak your mind on coding issues. You possess a burning desire to write high quality code. You are knowledgeable about the tools and techniques leading to robust, maintainable software. You are not afraid to try new things and enjoy the challenge of learning and applying new technologies. As a member of the software development team, you will be expected to contribute to both our core software products and to our agile development process.

Enough said!

We’re looking for smart, talented and motivated developers to come help us solve a few particularly challenging problems.

If you’re looking for a move (we’ll relocate from anywhere in North America), get in touch.

Dev Environment in a Nutshell : MacBook Pro + IntelliJ IDEA + Maven + JBoss AS + Swing + JBoss Seam + RESTful Web Services + TestNG