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.


  1. Jason van Zyl

    A note to anyone that uses Maven Archetypes: if the archetypes are deployed to Maven Central then the Nexus indexer will pick them up, and will therefore be made available to users of m2eclipse’s (m2eclipse.sonatype.org) new Maven project wizard automatically. No hunting around for archetypes, they are just presented in a list to the user when they create new Maven projects in Eclipse.

  2. ajordens

    Thanks Jason.

    Although I don’t use Eclipse, I should note that I’m a fan of the new ‘mvn archetype:generate’. My only problem was that the Seam archetype listed there is dated, and there’s still debate within the user community on what the preferred structure should look like.

    I take it that the m2eclipse archetype integration is somewhat similar, just all nice and packaged in the UI?

    Cheers!

  3. Brian Fox

    Rather than putting resources in the project as an extension, you should either place them as a dependency of the plugin that requires them, or use the dependency plugin to unpack them for use in your project. I wrote a how-to here: http://blogs.sonatype.com/brian/2008/04/17/1208485500000.html
    and here:
    http://blogs.sonatype.com/brian/2008/04/23/1208965980000.html

  4. ajordens

    I’ll check it out. I was basing the ‘extension’ usage off of what the Checkstyle plugin was recommending (http://maven.apache.org/plugins/maven-checkstyle-plugin/customize.html).

    Thanks for the tips Brian.

  5. Kelly

    I’m interested in working on something like that;)

Leave a Comment




  • Pet Peeve: Don’t email my password to me in plain text You know the drill. Signup for some random service on the internet Receive a confirmation email with your account information or Forget a password for some random service ...

  • Eclipise Memory Analyzer (MAT) I must say the Eclipse Memory Analyzer looks pretty slick. There is some pretty good material over on the developers blog. Lastly, there was a talk on it ...

  • Open-source Web-based Code Review Tool: Rietveld Guido van Rossum, of Python fame, has recently released a Django-based application that enables web-based code reviews... Rietveld. It supports any language and currently can hook into Subversion repositories. You ...

  • An implementation of the JVM in Javascript? Caught this over on JavaPosse Google Groups. Essentially, some bright fellows over in Japan have developed a bytecode->javascript compiler. There's a demo floating around that took a Tetris ...

  • Facebook Chat? So it looks like the Facebook Chat service has finally started rolling out to my network (Facebook Chat has been mentioned previously). Not quite sure how ...





  • RSS Twitter Feed

    • Meetings all day, no time to hit the gym. Guess I better go now.... 6:30am.
    • Played around with Fring for a couple minutes tonight, Skype seemed to work (if only to call a test account of mine). 3G would be nice! :)
    • Watched nick and norahs tonight. Have to admit that it was pretty funny. Two weeks until W, wonder what that's going to be like.
    • Locly is a pretty sweet location-based app for the iPhone. Should have busted it out last week in Seattle.