我曾经2.1.1:evalute -Dexpression=project.version
获得我的项目的版本,但这也会将其他内容打印到标准输出。无论如何要“关闭”这些[INFO]
线路吗?
我想应该可以只获得评估表达式的值,在这种情况下,它就是版本。
grep
顺便说一句,这是在 Windows 上,所以我不能awk
。
C:\Users\Owner\ mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate \
-Dexpression=project.version
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building myproject
[INFO] task-segment: [org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate] (e)
[INFO] ------------------------------------------------------------------------
[INFO] [help:evaluate {execution: default-cli}]
0.1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Mar 28 17:42:49 EDT 2013
[INFO] Final Memory: 9M/106M
[INFO] ------------------------------------------------------------------------