I have a big J2EE system that I’d like to rewrite some of in JRuby.
It’s a
maven2 multi-project, but I could easily split it up in different ways
if I
had to. I’m not a maven expert but I understand the basics.
At the simplest I’m looking for some advice on how to compile jruby
source to
.class files in a Maven project. I’m finding some things on the web
about
publishing jruby AS a maven project, or writing mojos in jruby, but
nothing
about using jruby as a java replacement, and just producing jars out of
it
(ideally mixed in with java source, but not completely necessary).
Something roughly equivalent to
http://dev.servprise.com/maven-jython-plugin/usage.html
–
Twitter: http://twitter.com/campbellmichael
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Fri, Sep 26, 2008 at 4:30 AM, Michael C.
[email protected] wrote:
Something roughly equivalent to
http://dev.servprise.com/maven-jython-plugin/usage.html
First, although we support ahead-of-time compilation with jrubyc, the
resulting class files are not necessarily easy to use from Java. You
still need to bootstrap a runtime and the mechanism for invoking those
classes is not too friendly. You may be able to use JSR-223
javax.scripting APIs or BSF to execute a "require ‘myscript’’ script
that would load the precompiled classes, but I haven’t tried this
personally.
As far as using Maven to compile the scripts, we don’t have a mojo for
this sort of thing, so you’re best off using something like the exec
or antrun plugin. You can make jruby-complete a dependency of the
plugin, and use “${maven.plugin.classpath}” as the classpath to the
java command that would launch jrubyc. Look inside the jrubyc script
for details of args to pass to java to launch the compiler.
Hope that helps,
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Nick S. wrote:
First, although we support ahead-of-time compilation with jrubyc, the
resulting class files are not necessarily easy to use from Java. You
still need to bootstrap a runtime and the mechanism for invoking those
classes is not too friendly.
Thanks Nick.
Not the answer I’d hoped for, but I’d rather be told the truth than what
makes
me feel good =)
That said, is an “easy” java-usable generated .class file on the roadmap
for
the future, or is this just not possible (or perhaps not even a goal of
the
project)?
–
Twitter: http://twitter.com/campbellmichael
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Fri, Sep 26, 2008 at 1:40 PM, Michael C.
[email protected] wrote:
makes me feel good =)
That said, is an “easy” java-usable generated .class file on the roadmap for
the future, or is this just not possible (or perhaps not even a goal of the
project)?
I believe that it is, I’ll leave it for Charles to give his brain dump
on those plans.
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email