Saturday, February 28, 2009

Cargo adds support for multiple data sources

Recently I've been working on getting the Selenium tests for the Apache Continuum project working again. Continuum is normally packaged in a Jetty bundle with everything it needs, but in order to automate the tests, I need to deploy just the webapp into a standard servlet container.

For a long time, Cargo only supported a single data source, so it wasn't possible to configure the Cargo Maven plugin to add the three data sources that Continuum needs -- two databases, for users and builds, plus one for sending email.

That changed recently, but when I tested out the new support for multiple data sources, I ran into a problem with the JNDI mail session. Just mentioning that on the Cargo dev list resulted in a quick fix.

It hasn't been released yet, but using the latest snapshot built from trunk, multiple data sources can be configured for the Cargo Maven plugin as follows:


<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
...
<configuration>
<home>${project.build.directory}/tomcat5x</home>
<type>standalone</type>
<properties>
<cargo.servlet.port>9595</cargo.servlet.port>
<cargo.datasource.datasource.users>
cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/users;create=true|
cargo.datasource.jndi=jdbc/users|
cargo.datasource.username=sa
</cargo.datasource.datasource.users>
<cargo.datasource.datasource.builds>
cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver|
cargo.datasource.url=jdbc:derby:${project.build.directory}/databases/${container.name}/builds;create=true|
cargo.datasource.jndi=jdbc/continuum|
cargo.datasource.username=sa
</cargo.datasource.datasource.builds>
<cargo.resource.resource.mail>
cargo.resource.name=mail/Session|
cargo.resource.type=javax.mail.Session|
cargo.resource.factory=org.apache.naming.factory.MailSessionFactory|
cargo.resource.parameters=mail.smtp.host=localhost
</cargo.resource.resource.mail>
</properties>
...


You can see a full example in the continuum-webapp-test module's pom.xml file:
http://svn.apache.org/repos/asf/continuum/trunk/continuum-webapp-test/pom.xml

... and in the Cargo docs:
http://docs.codehaus.org/display/CARGO/Starting+and+stopping+a+container

Sunday, August 10, 2008

Speed up Maven builds with repository groups

The more repositories Maven is configured to search, the slower the build can get, especially if the majority of the artifacts aren't found in the first repo it searches.

You can significantly speed up your builds by using a repository manager with a 'repository group' or 'virtual repository' feature. This allows you to hit a single url and have the repository manager do the work of checking each of its managed repositories behind the scenes, or of proxying the content from a remote repo and caching it for future requests.

To find out how to use virtual repositories with Apache Archiva, visit this link: http://archiva.apache.org/docs/1.1/userguide/virtual-repositories.html

Saturday, July 19, 2008

Looking forward to DSSS

With only one more week to go before the NFJS Desert Southwest Software Symposium, I'm really looking forward to this year's conference. Jay and crew do a fabulous job with these shows-- top notch speakers, a comfortable venue, and great food.

The only problem is that I often want to attend more than one talk in each time slot!

Sunday, July 13, 2008

What's on your plate?

For the last couple of months, I've been working with a personal trainer at Fitness Defined, and using The Daily Plate to track calories and nutrition.

Here's an example meal from this morning:


There's no cost to use the site to look up foods or to track your consumption. (You only get the breakdown by meal shown above if you pay for a Gold account, otherwise it's a daily total.) You can also use the site to track your weight and measurements, but there's a limit to how much personal information I want to part with.

The database is very well populated with brands name items and restaurant dishes, so it's fairly easy to keep an eye on things whether you're cooking at home, ordering in, or eating out. Of course, once you start paying attention to exactly how many calories there are in that slice of pizza, you may reconsider!

Friday, April 25, 2008

A week in Manila

I've spent the last week on the opposite side of the planet, right in the middle of Manila at the Exist Global office. This is my second time in the Philippines; a group of us went to Cebu last summer for a week. This time it's a longer trip, so I have a weekend in the middle... which is about ready to begin.

I've lost count of the number of malls I've been in, and the number of restaurants. We haven't yet been to the same place twice!

Sunday, April 13, 2008

ApacheCon EU Day 5

Friday was the last day of ApacheCon EU 2008 and finally time for the Apache Maven Best Practices session. It was well attended, with good questions at the end and afterwards. I wish it had been scheduled earlier, both because by Friday I was not feeling well at all, and because people would have been able to put a face with a name earlier and had more time to come talk about whatever was on their minds. Surprisingly I think I was the only Maven person about, unless they were hiding... In any case I did my share of consulting on builds for both other Apache projects and attendees' internal work, which is my favorite thing to do.

Aside from the aforementioned illness (apparently I need to work on better food choices when travelling!) I had a great time meeting even more people I've "known" for years online but never actually met in person.

Wednesday, April 9, 2008

ApacheCon EU Day 3

Today was the first day of the conference proper, with Jim's State of the Feather and a keynote from Cliff Schmidt on the work he is doing with Literacy Bridge.

This evening we had a "Build Tools and Repository Management" BOF. I left the topic vague hoping that some Ant and Ivy folks would wander in, but it ended up being primarily about Maven, with a little Linux/FreeBSD packaging and code signing thrown in.