【问题标题】:Maven. Get result of execution some shell comand马文。获取一些shell命令的执行结果
【发布时间】:2014-02-20 08:04:03
【问题描述】:

我想得到一些shell命令(git rev-list HEAD --count)的执行结果,比如标签的内容。像这样:

<git-count>git rev-list HEAD --count</git-count>

有没有办法做到这一点?

【问题讨论】:

标签: git maven-3 execution


【解决方案1】:

我建议你创建一个 shell 脚本,在该脚本中运行 git count 并将结果变量传递给 maven,例如

#!/bin/sh

GIT_COUNT=$( git rev-list HEAD --count )

mvn install "-Dgit-count=${GIT_COUNT}"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-09
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    • 2011-10-30
    • 1970-01-01
    • 2011-11-03
    • 2014-07-09
    相关资源
    最近更新 更多