AppFuse Light converted to Maven modules, upgraded to Tapestry 5 and Stripes 1.5
This past week, I stayed up a couple of late nights to do some of the AppFuse Light work I wrote about in October. I converted all web frameworks to Maven modules, as well as made them inherit from the appfuse-web project. Below is what the new module structure looks like:
At this point, the project is ready to import into AppFuse's SVN project. Here's a list of other changes I made:
- Modules now depend on AppFuse's backend and allow you to use Hibernate, JPA or iBATIS as the persistence framework. Implementations for Spring JDBC, OJB and JDO have been removed.
- Upgraded to JWebUnit 2.1, which now uses HtmlUnit under the hood and has much better JavaScript support. It also has Selenium support, but I've yet to try it.
- Ajaxified Body integrated into all frameworks. You can easily turn it off by modifying the global.js file.
- Prototype and Scriptaculous loaded from Google's Ajax Libraries CDN.
- Upgraded to Tapestry 5. Mad props to Serge Eby and his tapestry5-appfuse project for showing me how to do this. Serge became a committer on AppFuse recently, so hopefully we'll continue to see great things from the Tapestry 5 support. I really like the clean URLs and minimum configuration required in Tapestry 5. It's testing framework is nice too, but I believe it could be improved.
- Upgraded to Stripes 1.5. This was easy and painless. I'm definitely a fan of Stripes and look forward to reading the Stripes book on my bookshelf.
- Dropped support for: Struts 1.x, WebWork, Spring MVC + Velocity.
If you want to try any of these applications, you can create archetypes using the following commands:
svn co https://appfuse-light.dev.java.net/svn/appfuse-light/trunk appfuse-light cd appfuse-light/preferred-web-framework mvn archetype:create-from-project cd target/generated-sources/archetype mvn install cd ~/dev mvn archetype:generate # The new archetype should show up as an option
Next steps include figuring out a way to flatten the inherited dependencies and plugins so archetype:create-from-project can create truly standalone projects. Please let me know if you have any questions.
Posted by Marc on December 21, 2008 at 04:49 PM MST #
Personally, I'm disappointed to see support for Spring JDBC being removed from the project. In the organisation where I work, ORMs such as Hibernate are prohibited, so Spring-JDBC is the best option available to me. The prohibition of Hibernate is not a decision I agree with, but one I have to live with. Nevertheless for projects that have a DB of only a few tables, an ORM is probably overkill, and given that JDBC could be considered the "lingua franca" of database connectivity, maybe it's worth reconsidering this decision?
Keep up the great work!
Posted by Donal on December 22, 2008 at 05:04 AM MST #
I tried to follow your instructions, but it seemed to require an svn login. That makes sense, given https in the url.
Paul Sundling
http://www.gamerleague.com
Posted by Paul Sundling on January 04, 2009 at 01:46 PM MST #
This blogpost goes over what I mean:
http://rossenstoyanchev.org/blog/category/spring-mvc/
Especially given Spring 3 will deprecate the controller hierarchy, it might be interesting to try out the new style. The blogger did a really nice presentation at Spring One that explains it well. Too bad I haven't seen him post the presentation. I saw a copy from a coworker who went this year.
Posted by Paul Sundling on January 04, 2009 at 02:07 PM MST #
Appfuse lite was missing the codehaus repository, so it failed for me. Here is the working respository section from pom.xml. It will of course allready work for anyone who already have codehaus in their settings.xml:
BTW, I have a comprehensive presentation on Maven 2 at the LA Java User Group and I used Appfuse for the demo to show how you could start from nothing, get an archetype and go from there. :) Very good stuff, your efforts are appreciated.
I know it would be crazy because of the combinatorial effects, but have you thought about having multiple ajax library implementations to compare like you have frameworks. With approaches like Unobtrusive javascript, it might not be horrific to handle, perhaps just a different include per ajax framework that could all be changed via some switching mechanism. I really like jQuery myself. I imagine even the thought of that has you pulling your hair out. :)
Posted by Paul Sundling on January 04, 2009 at 04:35 PM MST #
@Donal - the good news is you can still use Spring JDBC. The dependency is in the classpath. The reason I dropped Spring JDBC is because AppFuse Light now uses AppFuse's backend (which doesn't have a JDBC implementation).
@Paul - have you tried FreeMarker? The reason I removed Velocity is because FreeMarker seems like a better option with better error reporting and support for JSP tags. As far as the svn login, it's "guest" with a blank password.
AppFuse Light's Spring MVC + Annotations: I'm sure this can be improved. Patches most welcome. ;-)
Why did you need the Codehaus repository? Which dependencies aren't found in the central repo?
Thanks to everyone for the feedback!
Posted by Matt Raible on January 04, 2009 at 06:22 PM MST #
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ----------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.appfuse
ArtifactId: appfuse-light
Version: 2.1-SNAPSHOT
Reason: Unable to download the artifact from any repository
org.appfuse:appfuse-light:pom:2.1-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
Posted by Randy Jones on January 12, 2009 at 08:27 PM MST #
@Randy - I believe you might need to do this as a second step:
Hope this helps.
Posted by Matt Raible on January 12, 2009 at 08:33 PM MST #
Posted by Kieron Edwards on February 18, 2009 at 03:20 AM MST #