Major prep work in Maven 3 paves way for future
October 15, 2010 —
Three is a big number for growing software, but for Apache Maven, three is just another step on a larger journey. Released on Oct. 8, Maven 3 offers better stability and performance, but the biggest changes won't be noticed by users. Under the hood, a great deal of work was done to prepare Maven for a future of building OSGi applications and using dynamic languages to script the build process.
Jason van Zyl, creator of Maven and founder of Maven-focused company Sonatype, said that the future of Maven required some major preparation in the core code, much of which was done in Maven 3. Among that work was the addition of hundreds of new unit tests to ensure that when new features are added, old ones don't break.
“From a user perspective, this release is probably not that exciting," said van Zyl. "We were trying to clean up the core. The work done was partly to enable the use of [Sonatype's] Tycho for building OSGi bundles. That is impossible in Maven 2. It's rapidly becoming the standard for building Eclipse plug-ins. Maven 2 just wasn't flexible enough to do that."
Maven 3 does add some new features, despite its presentation as a preparation for a future 3.1 release. “We rewrote the artifact resolution system in a library we call Aether," said van Zyl. "We totally extracted the Maven repository resolution system and made it a standalone library. It will guarantee Maven repository compatibility. Other build systems can use it, too. You can integrate Aether into any tool to add Maven repository capabilities."
Another new feature is one that developers and users won't notice unless they open the code behind Maven. van Zyl said that Maven 3 includes a complete replacement for dependency injection, one that chooses the Google Guice dependency injection library instead of Plexus.
“[Google Guice] is very akin to what Plexus was,” said van Zyl. “We did it because it was flexible; also, because it has the flexibility in its APIs that it can mimic other injection frameworks. It needed to be backward-compatible, so we were able to use the Guice. Nothing in Maven had to change. Nobody will notice the difference."
The final major piece of Maven 3 was the rewriting of the m2eclipse plug-in. The new code makes the plug-in easier to use and more elegant overall, van Zyl said.
Maven 3 is available as open-source software from the Apache Foundation.
Related Search Term(s): Maven