Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Output valid xml when executing mvn help:effective-pom

Tags:

xml

maven

maven-3

When I execute mvn help:effective-pom it also outputs [INFO] ... to stdout. Surpressing it via -q outputs nothing at all when dealing with correct files so

I want to pipe the effective pom into xmlstarlet to get the effective properties but as the output isn't a valid xml it fails.

A request for my usecase was closed as a wontfix (at least to my understanding) at http://jira.codehaus.org/browse/MPH-23 .

like image 669
oschrenk Avatar asked Feb 21 '12 14:02

oschrenk


People also ask

What is available in effective POM XML for Maven?

The effective-pom goal is used to make visible the POM that results from the application of interpolation, inheritance and active profiles. It provides a useful way of removing the guesswork about just what ends up in the POM that Maven uses to build your project.

What is effective POM XML?

Effective POM combines all the default settings from the super POM file and the configuration defined in our application POM. Maven uses default values for configuration elements when they are not overridden in the application pom.xml.

Which command can be used to view effective pom?

I selected the "mytest" project and then selected the "mvn help~effective-pom" external tool configuration. Here, we can see the console output from executing the "help:effective-pom" goal on "mytest".


1 Answers

Use output property:

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

like image 166
Andrew Avatar answered Sep 28 '22 07:09

Andrew