I would like to convert this bash script:
#!/bin/bash
if ! [ $# == 2 ]; then
echo Usage: update-module admin-password module-file
exit 1
fi
if ! [ -f $2 ];
Use GMaven to embed an inline Groovy Script, and use apache httpclient to implement the post request. Something like this:
org.codehaus.groovy.maven
gmaven-plugin
org.apache.httpcomponents
httpclient
4.0.2
generate-resources
execute
This uses the maven properties http.url
and http.attachmentFile
that you can specify on the command line using the -D syntax or in a pom.xml file in a
block. Obviously, you'd need to extend the functionality to what else your shell script is doing, but this should get you started.