I have a pom.xml file that executes a shell script, and the shell script has the prompt
"Enter 'YES' to have this script continue:"
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?
Thanks.
You could use Expect, writing a wrapper script which, in turn, calls the interactive script.
To install it on Ubuntu:
This script should work:
You're using an interactive script in non-interactive mode. The script should have a parameter (ie. --non-interactive, or -y / -n, etc.) which disable the prompt and force the answer.
I had a similar problem. One of my plugins was designed to display some information to user and proceed only after confirmation. When I had to use it on our CI build server, I ended up with this:
I assume that you could either go with this approach (if it works for you), or use
gmaven
plugin to execute Groovy code before the execution of your shell script that would write needed string to system input.Setup script run as
yes | ./script
in pom.xmlI ended up using https://bitbucket.org/atlassian/bash-maven-plugin and had this in my pom.xml file