Get clean machine-friendly Maven lines/xml/json output parseable by scripts in STDOUT?

前端 未结 2 1496
南旧
南旧 2021-01-21 14:23

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

2条回答
  •  伪装坚强ぢ
    2021-01-21 15:02

    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.

提交回复
热议问题