从 Maven 运行 Ruby 脚本 [英] running Ruby script from Maven

查看:61
本文介绍了从 Maven 运行 Ruby 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个大型遗留 Maven 项目,它试图在 script.rb 文件上执行 org.codehaus.mojo.exec-maven-plugin.这在 *nix 系统上运行良好,因为 script.rb 文件以:

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

(请注意,我对 Ruby 几乎一无所知.)

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

当然,这在 Windows 上不起作用,即使安装了 Ruby,在 PATH 中,并且与 .rb 文件相关联.

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

我查看了 http://mojo.codehaus.org/rubyscript-maven-plugin/ ,但是他们提到的存储库 http://propellors.net/maven-repo ,似乎已经不存在了.

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.

最终我想取消脚本并使用纯 Java,但与此同时,在这个单体项目中,我只是想让它在 Windows 上构建.知道如何在 Maven 中以跨平台方式对 .rb 文件执行 exec 吗?

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?

谢谢.

推荐答案

根据 这个那个你可以试试

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

这是我的 nexus 提供的最新版本.

which is the latest version my nexus offers.

这篇关于从 Maven 运行 Ruby 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆