1

I have a project module full of groovy scripts which are run via embedded IntelliJ Groovy shell. In a new issue I need to have one of those scripts being run in combination with crontab. Needless to say I cannot just run groovy myScript.groovy dev to have this script executed out of the box - no the dependencies are missing for sure.

I now need a way to have this one particular groovy script being compiled and ready to run out of the box (with the use of the "dev" parameter)

Assuming that I put the myScript.groovy into a directory

main/
|_src/
  |_groovy/

What do I need to have a maven build creating a usable executable for me to drop into my machine and let crontab run it accordingly.

I tried a lot of Maven Plugins - but never came far enough. Also I'm sure that there must be a way more trivial way to achieve this since it's a simple build operation in my opinion.

Stefan Zobel
  • 3,182
  • 7
  • 28
  • 38
xetra11
  • 7,671
  • 14
  • 84
  • 159
  • How are you creating the distribution? Are you making an über-jar? – Dave Newton Feb 20 '17 at 14:19
  • I'm about to drop the specific script I need in the main/src/groovy path. I don't want the other scripts to be packed as well. – xetra11 Feb 20 '17 at 14:22
  • But you'll need all the dependencies bundled as well; Groovy doesn't operate in a vacuum. Then you can follow a process roughly like http://stackoverflow.com/q/18255795/438992 – Dave Newton Feb 20 '17 at 14:47

0 Answers0