开发者

Any way to get a BeanShell (or Scala, or JRuby) REPL in a pure Java Maven2 project?

开发者 https://www.devze.com 2023-04-12 13:41 出处:网络
I have a Java only project using Maven2. It\'d be very useful to be able to get a REPL that has access to the full classpath of the compiled application and all libraries. In SBT, this is trivial for

I have a Java only project using Maven2. It'd be very useful to be able to get a REPL that has access to the full classpath of the compiled application and all libraries. In SBT, this is trivial for pure Scala and mixed Scala/Java projects: I run sbt console.

But it'd be very useful for开发者_运维问答 pure Java projects too. I'm not bothered about what language: Scala, obviously, is pretty good for this, as is BeanShell, but JRuby or Jython or Rhino or Clojure would do the job pretty well too. Basically I want to be able to interactively poke and prod objects.

What's the simplest way to get a REPL set up in a Maven project without having BeanShell or Scala or whatever being added as a runtime/compile-time dependency?


For JRuby, try the following. Does not require modifying your POM.

mvn org.jruby.plugins:jruby-rake-plugin:irb


The GMaven plugin allows you to launch the groovy shell / console. This should have all the project dependencies in the classpath.

0

精彩评论

暂无评论...
验证码 换一张
取 消