Takari | New Maven 3.3.1 Features: Core Extensions
This week we released Apache Maven 3.3.1 with many new features, but the changes to the core extension loading mechanism is the most significant addition. Why? It allows fairly radical behavioural changes in Maven without having to fork Maven's core or use custom Maven distributions. A concrete example of this mechanism in action is Polyglot for Maven: with stock Maven 3.3.1 you can dynamically load an extension that can read a POM encoded in a Ruby DSL. Extremely powerful, and entirely transparent to Maven's core.
The primary driver for this change to the core loading mechanism is work Takari is doing with customers to improve many basic Maven capabilities and develop a Continuous Delivery pipeline. For many of the changes all we require is a new lifecycle and those changes have gone into the Takari Lifecycle, but many other capabilties require deeper integration with Maven. These integrations take the form of Maven extensions and to date we have been using a custom Maven distribution with our new extensions being loaded from ${MAVEN_DIST}/lib/ext
Having custom Maven distributions, or asking users to drop required extensions into their ${MAVEN_HOME}/lib/ext is problematic for a number of reasons but most of all it's terribly inconvenient and error prone. All Maven users expect new capabilities in the form of build extensions (like Tycho) and plugins to be downloaded and integrated into Maven while it's running. Now core extensions can work the same way. As a developer on a project you can simply declare the core extensions you want loaded by enumerating them in a ${maven.multiModuleProjectDirectory}/.mvn/extensions.xml:
Read full article from Takari | New Maven 3.3.1 Features: Core Extensions
No comments:
Post a Comment