Tag Archives: How-To

How to make a plugin that runs once during a build


May 22, 2009 By
Brian Fox

With it’s default behavior, Maven runs a plugin invocation for each project in a multi-module build. For plugins that operate on a single project at a time, this is what the author wants.

Some plugins are what we call “aggregators” which means they actually do want all the information about the full multi-module build before execution. These plugins, when run on a tree of projects cause Maven to resolve all the children before calling the plugin’s execute() method. In this mode a plugin executes just once, but effectively on the whole tree at once. (as a side note, you never want to bind an aggregator goal in your pom as this would cause the plugin to run an n! recursive build since the lifecycle would step into each child and execute the aggregator…which would cause Maven to reresolve all the children, etc)

Sometimes neither of those behaviors are what you want.

Continue reading...

Categories: Uncategorized

Best Practices for releasing with 3rd party SNAPSHOT dependencies


January 26, 2009 By
Brian Fox

The Maven Release plugin enforces best practices for releasing Maven artifacts. In summary, the release plugin performs the following steps: Validate no local changes against your SCM Validate that there are no SNAPSHOT dependencies Convert the modules to the to-be released version Ensure the build and Unit/Integration tests succeed Commit the changes to SCM, then […]

Continue reading...

Categories: Uncategorized