This is the ninth of a series of posts on some of the personal projects I’ve been working on. As I hope you’ll see, they all fit together. The previous post covered MicroBean Jersey Container Grizzly2 HTTP CDI Extension. The next post covers MicroBean Commons CLI.
To install MicroBean Maven CDI, place it on your classpath.
The Maven Artifact Resolver project is the Maven-as-build-tool-independent “guts” inside of Maven responsible for transitive dependency resolution and management. (I’ve written before on this topic.) MicroBean Maven CDI makes this tooling available inside a CDI 2.0 environment (including Java SE CDI 2.0 applications), along with the common Maven conventions of user-specific
settings.xml files and local Maven repositories. Any interesting magic that it performs is really confined to the translation of Plexus annotations such as
Requirement to CDI injection points, which it does by virtue of the power of the CDI portable extension SPI.
There are many ways this could be useful. Consider—from within your CDI bean—taking in a Maven-style
String identifier and having it resolve to a local file automatically if that file is not already present in exactly the same way that Maven resolves it (jokes about “downloading the Internet” are hereby routed to
/dev/null, as usually these indicate an ignorance of the (well-documented)
updatePolicy element). As we’ll see, there are even more powerful things you can do with these capabilities. I’ve touched on some of them earlier.