0

We have a large legacy Maven project that tries to do a org.codehaus.mojo.exec-maven-plugin on a script.rb file. This runs fine on *nix systems, because the script.rb file starts with:

#!/usr/bin/env ruby

(Note that I know next to nothing about Ruby.)

Of course this doesn't work on Windows, even with Ruby installed, in the PATH, and associated with .rb files.

I looked at http://mojo.codehaus.org/rubyscript-maven-plugin/ , but the repository they mention, http://propellors.net/maven-repo , doesn't even seem to exist anymore.

Eventually I want to do away with the script and go pure Java, but in the meantime on this monolithic project I'm just trying to get it to build on Windows. Any idea on how I can do an exec on a .rb file in a cross-platform manner in Maven?

Thanks.

Garret Wilson
  • 18,219
  • 30
  • 144
  • 272

1 Answers1

1

According to this and that you could try

<dependency>
  <groupId>de.saumya.mojo</groupId>
  <artifactId>gem-maven-plugin</artifactId>
  <version>0.25.1</version>
</dependency>

which is the latest version my nexus offers.

Jan
  • 930
  • 9
  • 25
  • So versions 0.26.0 and 0.27.0 are out, but they are [broken](https://github.com/mkristian/jruby-maven-plugins/issues/11). I have 0.25.1 almost working with the tag, but how do I pass arguments to the Ruby file (e.g. `${project.basedir}/bin/autopatch.rb ${test.config}`)? It appears to think that the whole thing is the filename and gives me a "no such file" error. I don't see any separate parameter for command-line arguments. – Garret Wilson Jun 18 '11 at 22:29
  • Sorry, I don't have an answer for that but I guess it should be possible: I would either (since it's a "meantime solution") paste the autpatch.rb inline or ask the developer about it. – Jan Jun 20 '11 at 08:53
  • Turns out the developer was really helpful, and informed me that I can use '${test.config}'. Works great! Version 0.27.0 is still broken, but hopefully that will be fixed soon. – Garret Wilson Jun 20 '11 at 19:36