Monday, June 4, 2007

Output Your Effective Pom to disk

The problem:

You would like to have a copy of the effective pom file used in your project. The effective pom is your current projects pom merged with any inherited poms.

The solution:

If you have read the post "Seeing the Big Picture with Inherited Poms" you know that by type "mvn help:effective-pom" a copy of the effective pom will be outputted to your screen. This is nice but what if you want a copy of this on file? Maybe you would like to attach it to an email, or use it to cut and paste together a new file. Well Maven has this one covered. Use the following command
mvn -Doutput=<filename> help:effective-pom
Where <filename> is the name of the file you would like the effective pom written to.