Valid xml output when running mvn help: effective-pom

When I execute mvn help:effective-pom , it also outputs [INFO] ... to stdout. Compression with -q does not display anything when working with the correct files, therefore

I want to pass efficient pom to xmlstarlet in order to get efficient properties, but since the result is not valid xml, it fails.

The request for my usecase was closed as wontfix (at least until I understood it) at http://jira.codehaus.org/browse/MPH-23 .

+7
source share
2 answers

Use output property:

mvn help: effective-pom -Doutput = <FILE>

+8
source

As a workaround

 mvn help:effective-pom | grep -v '\[INFO\|\[WARNING\|Downloading' | sed '1,2d' | xml sel -N x=http://maven.apache.org/POM/4.0.0 -t -c "/x:project/x:properties" 

will display the properties as xml.

You need xmlstarlet .

 brew install xmlstarlet #OSX apt-get install xmlstarlet 
+4
source

All Articles