Apache Maven 2 Effective Implementation book (final version) now available!
After almost a year of writing and revising, our book is finally finished and published
The book is about Apache Maven and centered on a "best practices" approach. It is not the usual how-to books but more on effective usage and application of Maven in your projects/applications. You will also learn how to use Maven together with Apache Continuum (continuous integration server) and Apache Archiva (a repository manager) and use these tools to your advantage.To learn more about these projects, visit:
You can grab a copy of the book at www.packtpub.com/apache-maven-2-effective-implementations/book. Grab a copy now while it’s still on sale
(Thanks again to everyone who helped us out and supported us with this book!)
“Managing Your Repositories with Archiva” @ApacheCon Europe 2009
ApacheCon Europe is coming up!** I’m given the privilege of holding an hour long session at the conference to talk about Archiva. Here’s a short summary of what I will be covering in my presentation: www.eu.apachecon.com/c/aceu2009/sessions/169
Wendy Smoak and Carlos Sanchez will also be speaking at the conference. Wendy will be doing a presentation on Apache Continuum www.eu.apachecon.com/c/aceu2009/sessions/170 while Carlos will be talking about Enterprise Build and Test www.eu.apachecon.com/c/aceu2009/sessions/171, and Eclipse IAM www.eu.apachecon.com/c/aceu2009/sessions/185
See you all in Amsterdam!
**ApacheCon Europe 2009 is on March 23-27 at Movenpick Hotel, Amsterdam - www.eu.apachecon.com/c/aceu2009/
Configuring JSW + embedded Jetty with JMX
I thought I’d share this knowledge that I’ve learned while migrating our project to be distributed in a Jetty bundle JMX (see java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/)
I’ve summarized this into the following steps:
1. You must have a jetty-jmx.xml file with the following configuration:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id="Server" class="org.mortbay.jetty.Server">
<!– =========================================================== –>
<!– Initialize an mbean server –>
<!– =========================================================== –>
<!– Use the jdk 1.5 platformMBeanServer –>
<Call id="MBeanServer" class="java.lang.management.ManagementFactory" name="getPlatformMBeanServer"/>
<!– =========================================================== –>
<!– Initialize the Jetty MBean container –>
<!– =========================================================== –>
<Get id="Container" name="container">
<Call name="addEventListener">
<Arg>
<New class="org.mortbay.management.MBeanContainer">
<Arg><Ref id="MBeanServer"/></Arg>
<!– If using < jdk1.5 uncomment to start http adaptor –>
<!– Set name="managementPort">8082</Set –>
<Call name="start" />
</New>
</Arg>
</Call>
</Get>
</Configure>2. In your wrapper.conf file, add the jetty-jmx.xml file in the Application Parameters section like the following:
wrapper.app.parameter.1=org.mortbay.start.Main
wrapper.app.parameter.2=[PATH_TO_JETTY_CONFIG]/jetty-jmx.xml
wrapper.app.parameter.3=[PATH_TO_JETTY_CONFIG]/jetty.xml3. Add also the following in the Java Additional Parameters section of the wrapper.conf:
wrapper.java.additional.7=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional.8=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.9=-Dcom.sun.management.jmxremote.port=99994. Start the Jetty bundle by invoking the startup script for the JSW.
5. To see if JMX was enabled, use jconsole to connect. In jconsole, create a new connection and in the Advanced tab, provide the following JMX url then click Connect:
service:jmx:rmi:///jndi/rmi://127.0.0.1:9999/jmxrmiAfter step 4, you should be able to see the Memory, Threads, Classes and MBeans info of your application.
Specifics for the tools used above:
- appassembler-maven-plugin 1.0-beta-2
- java 1.5.0_11
- jetty 6.1.11
- jsw 3.2.3
Continuum 1.3.1 (Alpha) now released!
Continuum 1.3.1 (Alpha) has been officially released today! Although this is just an alpha release, there’s a vast amount of new features (in it’s initial implementation) to look out for as can be seen in the release notes below:
Release Notes - Continuum - Version 1.3.1
** Sub-task
* [CONTINUUM-2023] - Document usage of parallel builds** Bug
* [CONTINUUM-1513] - Release does not work when maven 2 executable is not on PATH
* [CONTINUUM-1978] - regression from 1.1 to 1.2.2: Add Maven 2.0+ Project using https POM Url where the source server has self signed certificate
* [CONTINUUM-1981] - Error while using Windows domain in username when adding a M2 project
* [CONTINUUM-1984] - Dead link to data-management-cli-1.2-app.jar in upgrade documentation
* [CONTINUUM-1988] - Cannot build project if triggered from Project Information page
* [CONTINUUM-1998] - Unable to delete a user
* [CONTINUUM-1999] - Missing validation error message for duplicate project group
* [CONTINUUM-2008] - Creating or Editing "build definition" and "build definition template" generates javascript error
* [CONTINUUM-2017] - Unable to add build definitions to a template
* [CONTINUUM-2021] - NullPointerException when sending mail notification
* [CONTINUUM-2030] - Show Users in Role paging not working
* [CONTINUUM-2035] - Unable to release when Distributed Build is enabled
* [CONTINUUM-2040] - NPE encountered when building a project migrated from an old database** Improvement
* [CONTINUUM-1829] - separate transient errors from build failures in notification and display
* [CONTINUUM-1864] - Transient State
* [CONTINUUM-1884] - Clicking ‘Done’ after a successful release perform sends you all the way out to the list of groups
* [CONTINUUM-1962] - Migrate to Struts 2
* [CONTINUUM-1969] - Externalize all strings and make continuum fully localizable.
* [CONTINUUM-2010] - Add group cancel build
* [CONTINUUM-2013] - Database migration tool for migration from 1.2.x to 1.3.x** New Feature
* [CONTINUUM-265] - Concurrent builds
* [CONTINUUM-1666] - Distributed Builds** Task
* [CONTINUUM-1990] - Unable to publish website from 1.3.0 tag
* [CONTINUUM-2024] - Upgrade httpclient to 4.0beta2** Wish
* [CONTINUUM-1635] - Manage configurable number of parallel build queuesBTW, the release can be obtained here: http://continuum.apache.org/download.html
Enjoy!
BarCampApache @ApacheCon US 2008
For the first time in Apache Con history, Apache will be hosting a bar camp! Visit http://barcamp.pbwiki.com/BarCampApache for more details
Archiva @ApacheCon US 2008
I was given a chance to do a fast feather talk about Archiva at the ApacheCon US 2008 on Wednesday Nov. 5, 3pm at the Sheraton Hotel in New Orleans. See you there!
Generating RSS Feeds with Rome
Want to have RSS feeds in your Java application? Try Rome..
"Rome is an open source library for generating, parsing and manipulating RSS and Atom feeds. It supports different RSS and Atom feed formats such as Atom 0.3, and Atom 1.0, RSS 0.90, RSS 0.91 Netscape, RSS 0.91 Userland, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0 and RSS 2.0."
A couple months back, I got to use the Rome library to implement RSS in Archiva. What I liked about Rome is how it’s so easy to understand and use. To generate an RSS feed, you basically just need to be familiar with these three classes: SyndFeed, SyndEntry and SyndContent. These three are Java interfaces with the following concrete implementations: SyndFeedImpl, SyndEntryImpl and SyndContentImpl respectively. Here’s a short example on how you can generate a RSS 2.0 feed:
SyndFeed feed = new SyndFeedImpl(); // create the feed
Date publishDate = new Date( System.currentTimeMillis() );feed.setTitle( "Techblog.ph RSS Feeds" );
feed.setDescription( "RSS feeds of blog entries from Techblog.ph" );
feed.setLanguage( "en-us" );
feed.setPublishedDate( publishDate );
feed.setFeedType( "rss_2.0" ); // set the type of your feedList<SyndEntry> entries = new ArrayList<SyndEntry>();
SyndEntry entry = new SyndEntryImpl(); // create a feed entry
entry.setTitle( "Generating RSS Feeds with Rome" );
entry.setPublishedDate( publishDate );SyndContent content = new SyndContentImpl(); // create the content of your entry
content.setType( "text/plain" );
content.setValue( "Want to have RSS feeds in your Java application? Try Rome….." );entry.setDescription( content );
entries.add( entry );
feed.setEntries( entries ); // you can add multiple entries in your feedFor the published date, make sure that you update it whenever you have a new entry and publish the feed so that the reader knows there were changes/updates in your feed.
Now, to publish your feed.. you can write it into a file (example, write it to rss.xml) which the feed reader checks for updates or you can generate the feed by request (like how it is done in Archiva). If you are publishing your feeds by writing it on a file, you might need to read the file into a SyndFeed before adding new entries as shown below:
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build( new XmlReader( outputFile ) );To learn more about the Rome library, check out the Rome API.
BarCamp in Manila tonight!
BarCamp in Manila tonight at the G2VC Innovation Center, starts at 7pm.. Sign up now!
For more details, visit barcamp.org/BarCampManila
See you there!
Groovy Users Group First Meetup Tomorrow!
The first meetup of the Groovy Users Group will be held tomorrow 7pm at the Orange and Bronze office in Makati.
Topics to be presented:
- Intro to Groovy by Michael Mallete
- Grails + Acegi walkthrough by Melvin Dave Vivas
For more details, visit groups.google.com/group/philippine-groovy-users/browse_thread/thread/a835c5c84b6f9679
See you there!
Maven @ the POSS
Last June 23-24, the Philippine Open Source Summit (POSS) was held in Cebu and I got to do a technical session about Maven. For those who didn’t get to attend, here’s a short summary of what was presented and discussed in the session =)
- What is Maven?
- It is a software project management and comprehension tool that can manage a project’s build, reporting and documentation from a central piece of information.
- Before Maven was around you need to..
- Compile your project (dependencies, source classes)
- Package your project
- Test your project
- Document your project
- Deploy/publish your project
- Life with Maven.. Maven does it ALL!
- Building a project with Maven is demonstrated (from compiling your project up to deployment), showing the Maven build life cycle.
- A diagram of how Maven works

- Definition of Terms:
- Repository (remote and local) - where artifacts are contained
- Artifact - a jar, war, ear, zip, tar, etc. file
- POM (Project Object Model) - the central piece of information; xml configuration file where all info (build, reporting, resources, etc.) regarding the project is located
- Dependency - an artifact which is needed by your project in order to build or run it
- Build - steps for preparing your project for deployment (compile, test, package, deploy, etc.)
- The Power of Maven (reference: maven.apache.org/maven-features.html)
- Simple project setup that follows best practices
- Consistent usage across all projects means no ramp up time for new developers coming onto a project
- Superior dependency management
- Support for multi-module projects
- Extensible (you can create your own plugins!)
- Coherent site of project information
- Release management and distribution publication
- Related Tools:
- Apache Archiva – Build Artifact Repository Manager
- Apache Continuum – Continuous Integration Server
- Features of Archiva:
- can be used as proxy cache of artifacts
- manage repositories (deploy/upload artifacts, search, cleanup)
- provides reports (repository health)
- security (for your repositories)
- Features of Continuum:
- scheduled builds (m2, m1, ant and shell projects)
- build notification (mail, irc, IM clients)
- has support for build environments
- web UI for releasing a project
- security (across project groups)
- Resources:
- Maven website - maven.apache.org
- Books on Maven:
- Better Builds With Maven - repo.exist.com/dist/maestro/
- Maven: The Definitive Guide - www.sonatype.com/book/#
- Archiva website - archiva.apache.org
- Continuum website - continuum.apache.org
- What is Maven?


