当我使用以下命令时: -
mvn dependency:list -DoutputFile=/path/to/file.txt -DappendOutput=true
结果无效,Maven 告诉我
[INFO] --- maven-dependency-plugin:2.1:list (default-cli) @ ...
然后我更改以指定版本
mvn org.apache.maven.plugins:maven-dependency-plugin:2.6:list -DoutputFile=/path/to/file.txt -DappendOutput=true
结果是有效的,Maven 告诉我
[INFO] --- maven-dependency-plugin:2.6:list (default-cli) @ ...
我建议您确保执行的是2.6 版本。无论如何,我总是使用以下命令作为
mvn dependency:list > /path/to/file.txt
恕我直言,每个模块的结果更好,更清晰,如下例所示: -
[INFO] Scanning for projects...
[INFO] -------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my-parent
[INFO] my-sub1
[INFO] my-sub2
[INFO]
[INFO] -------------------------------------------------------------------
[INFO] Building my-parent
[INFO] -------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:list (default-cli) @ my-parent ---
[INFO]
[INFO] The following files have been resolved:
...
[INFO] -------------------------------------------------------------------
[INFO] Building my-sub1
[INFO] -------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:list (default-cli) @ my-sub1 ---
[INFO]
[INFO] The following files have been resolved:
...
[INFO] -------------------------------------------------------------------
[INFO] Building my-sub2
[INFO] -------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:list (default-cli) @ my-sub2 ---
[INFO]
[INFO] The following files have been resolved:
...
[INFO]
[INFO] -------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] my-parent ........................................ SUCCESS [0.745s]
[INFO] my-sub1 .......................................... SUCCESS [0.675s]
[INFO] my-sub2 .......................................... SUCCESS [0.671s]
[INFO] -------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] -------------------------------------------------------------------
[INFO] Total time: 2.938s
[INFO] Finished at: Fri Mar 01 17:01:39 ICT 2013
[INFO] Final Memory: 17M/218M
[INFO] -------------------------------------------------------------------
我希望这可能会有所帮助。
问候,
查理·Ch。