I have Maven to copy files to the remote server, my code snippet is below
<scp trust="true" file="myfile.txt" todir="myuser:mypassword@myserver:/remotedir">
<sshexec trust="true" failonerror="true" host="myserver"
username="myuser" password="mypassword" ....>
Is there a way to avoid hard-coding password? Would like to have a prompt while executing mvn
I assume that you use the maven-antrun-plugin because this snippet looks more like an ant script.
As described in this answer you can pass maven properties to the maven-antrun-plugin:
You can now pass the property value via command line to the maven build: