Archive for the ‘Maven’ Category

DZone Maven RefCard Released

Friday, May 29th, 2009

MavenRefCard.jpgI’m very pleased to announce that my DZone Maven RefCard was released this week ahead of schedule, and JavaLobby did a little introductory interview for the launch. A handful of folks contributed to the early alpha reviews and I want to acknowledge their inputs: Ken Sipe, Tim O’Brien, Chris Maki, Tim Berglund, and Jason van Zyl.

The timing was great, as I did a Mastering Maven talk at the San Diego Java Users Group (SDJUG) on Tuesday night. A handful of the attendees came with printed copies of the RefCard in hand!

I’m always looking for ways to contribute to the Maven community, and this was by far the most fun I’ve had building materials to promote this unique Convention over Configuration build tool.

Maven 3.0 Early Access

Sunday, April 19th, 2009

Maven 3.0, a mostly-backwards compatible, but significantly improved and extensible version of Maven is developing very quickly. Jason van Zyl hosted a Maven Meetup at their offices in Mountain View in March of this year. Lots of deep information about Maven 2.0 and 3.0 was shared, and videos of some of the sessions are now starting to be posted to the Vimeo web site. The Maven 3.0 video is especially insightful:



Jason van Zyl on Maven 3 from Sonatype on Vimeo.

Here are the takeaway points, highly distilled to 140 proof, for those without time to watch the video:

  • Improved overarching performance (tools, engine, resolution, downloads, builds)
  • Better tooling integration
  • Tie-ins with OSGi
  • Excellence in Eclipse integration
  • Possibility of non-XML POMs
  • Lifecycle extension points
  • High-performance artifact resolution engine
  • Documentation-hyperlinked error messages

If you want to get access to the Maven 3.0 code, you can view the list of SVN checkout URLs here (or here for the hardcore Git lovers), or just view the source in your browser here. If you want early access to the binaries, you can download them from Apache.

Maven Unit Tests and Continuous Integration Servers

Wednesday, March 11th, 2009

If you are running a Continuous Integration server such as Hudson, you’ll want to consider routing your SureFire outputs to the console so that they’ll appear in the build-report logs. If you leave SureFire at its default, it will output each test’s success or failure to an individual test XML and TXT file, but those are likely not in an exposed directory on your CI server. If instead, you route the output to the console, it will get reported in your failure emails that your CI server is capable of sending.

Just pass the useFile=false parameter on the command line or set it in the plugin config section of your pom.xml.

mvn test -Dsurefire.useFile=false

Before:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ambientideas.AppTest
Hello World! This is a JUnit test!
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec <<< FAILURE!Results :Failed tests:testApp(com.ambientideas.AppTest)Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

After:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.ambientideas.AppTest
Hello World! This is a JUnit test!
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec <<< FAILURE!
testApp(com.ambientideas.AppTest)  Time elapsed: 0.014 sec  <<< FAILURE!
junit.framework.AssertionFailedError
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertTrue(Assert.java:27)
at com.ambientideas.AppTest.testApp(AppTest.java:37)

Results :Failed tests:testApp(com.ambientideas.AppTest)Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

Using the Maven Command Line Interface Plugin

Thursday, February 19th, 2009

Maven 1.0 users were spoiled with the console plugin, and now Maven 2.0 users can get a nearly equivalent experience with a high-performance bootstrapped prompt via the Command Line Interface plugin. Watch this quick screencast for a tour of using this plugin and start saving even more time with Maven.