If you havent worked with java in a while - I think you will find the following process interesting on catching up on where things have moved.

Changes in Java
1) First there is a list of all the enhancements to java over time

Ant and Maven
2) Ant is still great for building a one off custom java app but custom ant scripts for each project have now been replaced with the Maven pom.xml files - which uses "convention over configuration" to standardise the way code is built, packages, deployed etc. This is useful for large orgs of java developers.

Learning to install and work with maven is very quick - 1 day job
Simply go though all the tutorials in the maven book. Eventually you reach the point where there is:

    a single top level pom which "verlocks"(version locks) the versions of the dependencies
    seperate pom files per sub project which simply reference a dependency (no version number is supplied)

Jetty vs Tomcat
3) jetty seems has overtaken tomcat

"

  • requests/responses are sent over a few connections without any significant idle time.
  • Jetty tends to have better scalability when there are many connections with significant idle time, as is the situation for most web sites. Jetty's small memory footprint and advance NIO usage allows a larger number of users per unit of available memory. Also the smaller footprint means that less memory and CPU cache is consumed by the servlet container and more cache is available to speed the execution of non-trivial applications.
  • Jetty also has better performance with regards to serving static content, as Jetty is able to use advance memory mapped file buffers combined with NIO gather writes to instruct the operating system to send file content at maximum DMA speed without entering user memory space or the JVM."

and can jetty can be run from within Maven using

mvn jetty:run

If you see this error message:

"The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist or no valid version could be found"

you have to make certain you are in the correct pom directory - it needs to be the pom one that creates the war

4) Even though java now has annotations - there is an insane amount of xml situps (lots of xml configuration files)

The archi project allows for generation of hello world style code for various frameworks.


[pbirnie@~/java_dev/maven_tut>java -jar archy-0.1.jar
Enter the archetype id [struts2-archetype-starter], or type 'list': appfuse-basic-spring