如何在Maven中处理Shell提示 [英] How to handle shell prompt in maven

查看:70
本文介绍了如何在Maven中处理Shell提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个执行shell脚本的pom.xml文件,并且该shell脚本具有提示符

I have a pom.xml file that executes a shell script, and the shell script has the prompt

输入'YES'以使该脚本继续:"

"Enter 'YES' to have this script continue:"

我如何告诉Maven 1)解析提示,2)看到提示时输入YES?

How do I tell maven 1)Parse the prompt, 2)Enter YES when it sees the prompt?

或者至少是上面第二个问题的答案?

Or at the least, an answer to the second question above?

谢谢.

推荐答案

我最终使用了 https: //bitbucket.org/atlassian/bash-maven-plugin 并将其保存在我的pom.xml文件中

I ended up using https://bitbucket.org/atlassian/bash-maven-plugin and had this in my pom.xml file

    <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>bash-maven-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        <executions>
            <execution>
                <id>execute-shell</id>
                <phase>generate-sources</phase>
                <goals>
                    <goal>run</goal>
                </goals>
                <configuration>
                    <script>./build_dm.sh --accept-warning</script>
                </configuration>
            </execution>
        </executions>
    </plugin>

这篇关于如何在Maven中处理Shell提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆