For example, run this command with for a maven project:
mvn dependency:list
What I need from Maven is only these two lines (cut out fr
Maven uses standard slf4j logging, wrapped in a plexus container. https://maven.apache.org/maven-logging.html
You should be able to configure the slf4j bindings to provide different output formats as detailed here http://logback.qos.ch/manual/layouts.html#log4jXMLLayout
I'm not familiar with the cleanlines and json logging formats; however, slf4j is probably one of the more adaptable logging packages, so look around for a Formatter and you have a chance at finding one. However, if you don't the last link above also covers the pages on how to write your own logging layout.
I was able to supply a property to save required clean output into a file.
For example, -DoutputFile or -Doutput:
mvn dependency:list -DoutputFile=dependencies.output.txt
mvn help:effective-pom -Doutput=effective.pom.xml
If STDOUT is required, cat
the file.
Even though it's not generic, so far, the workaround solves all cases for me.