robjsoftware.org

A blog about software – researching it, developing it, and contemplating its future.

Mavenizing GWT-JSF

leave a comment »

As aforementioned here, I’ve spent a good chunk of this year integrating GWT, JSF, and Seam. The current fruits of that labor are here.

The original GWT-JSF integration was done by the Ajax4JSF guys. The code is hosted in the JBoss Ajax4JSF Subversion repository. The main problem is that they’ve converted the entire repository to use Maven, except for the GWT-JSF code.

So I’m fixing that. This post documents how. I’m going to try your patience by giving the blow-by-blow in real-time as I work on this. Consider this an object lesson in how to bang your head against a brick wall with MAVEN spray-painted on it.

First, get the Ajax4JSF code building with Maven, by following these directions from the Ajax4JSF guys.

Second, integrate a pointer to the GWT-Maven repository, along the lines of these instructions from the GWT-Maven team. Specifically:

– Add the gwt-maven repository to conf/settings.xml:

<!-- add gwt-maven repository -->
<repositories>
<repository>
<id>gwt-maven</id>
<url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/</url>
</repository>
</repositories>

– Update the GWT dependencies in the main project POM to 1.4.10.

– Add

<scope>provided</scope>

to the gwt-user dependency, to keep it out of the WAR file. (gwt-user.jar is only for compile time; gwt-servlet.jar is all you need in your deployed GWT webapp.)

Why can’t the gwt-maven repository live just inside the GWT-JSF POM? In fact, why don’t ALL the necessary repository definitions just live inside the top-level trunk POM for Ajax4JSF?

Third, run “mvn install” in the ajax4jsf/trunk/gwtjsf directory. See it blow up because it can’t find the 2.0 version of jsp-api.jar.

Wonder why this is, since the top-level trunk build has no problem finding it. Flail around adding a <profile> to the POM and watch it die in all kinds of other interesting ways. Back that change out again. Realize that you really have no idea how Maven works. Look at the base dependencies again…

… Turns out to be because the gwtjsf POM has the wrong groupId for jsp-api — it should be javax.servlet.jsp but it was just javax.servlet.

And with that, the frickin’ thing compiles! That’s progress 😀

What’s more, it’s almost 1 AM and my baby daughter wakes up at 6:30 AM. (Get used to me saying that.) But hey, something works now that didn’t work when I sat down here tonight. That’s what hacking is all about: getting something new working. Get enough new things working, and anything’s possible.

Time to commit all this to Perforce (see my next post) and then off to bed. Next hack night probably on Saturday, or if not, next Monday. Hopefully I’ll be able to land this sucker, and then maybe even land my actual changes to the project! What a concept!

Advertisements

Written by robjellinghaus

2007/06/15 at 06:38

Posted in GWT, JSF, Maven

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: