Build an accurate release pom when doing a release in Maven
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


release-pom Maven Plugin


The purpose of this plugin is to ensure that on release, a fully resolved POM (including all transitive versions and their resolved versions) is written to disk and pushed along with the released artifact.

This enables you to do patch releases, where all artifacts need to remain the same, but one will probably change.


Put this in your pom:


If you only want this to occur when a release is actually occurring, you can put it inside a profile like this:

      <!-- adtivate the sonatype profile when a release is being done -->

You can specify two parameters on the configuration:

  • useMaven2 - if you find that the dependency tree is incorrect, Maven 3’s dependency tree as passed to the Dependency plugin is infrequently wrong. Set this to true and make sure you are using a version of the dependency plugin that supports Maven 2.

  • outputFile - specifies where you want the file to go. I recommend the output directory that gets jar’d up so it gets included along with everything else.


The plugin generates only a full dependency tree, it does not attempt to release the pom with plugins and properties. As these don’t change on release and have no version ranges capability, for me they are not yet important.