« Return to Thread: Running a JRuby Script With Maven

Re: Running a JRuby Script With Maven

by keithrbennett :: Rate this Message:

Reply to Author | View in Thread

Leonardo -

Thanks for providing that, but I don't know how I would modify
it to suit my needs.  I've thought about it more, and here is a
restatement of my needs that will hopefully be clearer:

I'm looking to find or write a plugin that would drive JRuby
scripts with a specified set of jar file dependencies.

The scripts would merely be arguments to the Maven command, and
don't even need to be in the project tree.  Here's what I'd like
this plugin to do:

* calculate transitive dependencies

* download them if necessary

* build a command line with the classpath, "java -jar
...jruby.jar", and any arguments passed to the Maven command

* run that command

Although it is not a clean fit with Maven's usual use pattern, I
don't know of any tools other than Maven that can do anywhere as
good a job at downloading dependencies and storing them in one
central location.

Everything I need to do is already done by Maven; I just don't
know how to isolate those behaviors and tie them together.

It could be run something like this:

mvn run-jruby my-script.rb arg1 arg2

All scripts run using this Maven project would share the same set
of jar file dependencies.  I don't see this as a big problem, as
I'm envisioning using them for system administration tasks that
would probably share the same dependencies anyway.

It would be nice if there were a variant to just output the
generated command too; this way, if the script were run many
times, the repository would not be checked each time.

Regards,
Keith

 « Return to Thread: Running a JRuby Script With Maven