You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "James A. Hillyerd" <ja...@activerain.com> on 2004/03/02 03:58:45 UTC
Launching BeanShell/Groovy from Maven?
I'm looking for a way to launch BeanShell (or Groovy, either one will
work for me) from Maven. My goal is to have an interactive scripting
shell with a classpath containing all of my project's dependencies, and
"target/classes" itself.
I'm new to Maven, it's not something I can figure out how to do myself.
I've searched the web for an example but there was a lot of noise in the
results since Groovy uses Maven to build, and Maven supports(?) writing
plugins in BeanShell.
Has anyone done this? It seems like it would make a really useful maven
plugin, since it would let you test ideas without writing experimental
classes and launch scripts, etc.
Thanks!
-james
--
James A. Hillyerd <ja...@activerain.com>
http://www.activerain.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Launching BeanShell/Groovy from Maven?
Posted by James Strachan <ja...@yahoo.co.uk>.
On 2 Mar 2004, at 08:34, James A. Hillyerd wrote:
> Okay, so I guess I was too impatient to wait for an answer to my
> question! After a bunch more research and some trial and error, I came
> up with the following maven.xml:
>
> <project default="java:compile" xmlns:j="jelly:core"
> xmlns:u="jelly:util" xmlns:ant="jelly:ant">
>
> <goal name="bsh">
> <attainGoal name="java:jar-resources"/>
> <attainGoal name="java:compile"/>
> <ant:java classname="bsh.Console" fork="true">
> <ant:classpath>
> <ant:path refid="maven.dependency.classpath"/>
> <ant:pathelement path="${maven.build.dest}"/>
> </ant:classpath>
> </ant:java>
> </goal>
>
> </project>
>
> Which appears to do what I want. (You can change "bsh.Console" above
> to "bsh.Interpreter" if you don't want a windowed interface)
FWIW if you want a groovy interactive shell then just change the
classname in the above to groovy.ui.InteractiveShell
James
-------
http://radio.weblogs.com/0112098/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Launching BeanShell/Groovy from Maven?
Posted by "James A. Hillyerd" <ja...@whynotown.com>.
Okay, so I guess I was too impatient to wait for an answer to my
question! After a bunch more research and some trial and error, I came
up with the following maven.xml:
<project default="java:compile" xmlns:j="jelly:core"
xmlns:u="jelly:util" xmlns:ant="jelly:ant">
<goal name="bsh">
<attainGoal name="java:jar-resources"/>
<attainGoal name="java:compile"/>
<ant:java classname="bsh.Console" fork="true">
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
</ant:classpath>
</ant:java>
</goal>
</project>
Which appears to do what I want. (You can change "bsh.Console" above to
"bsh.Interpreter" if you don't want a windowed interface)
Hopefully some of you will find it useful.
-james
James A. Hillyerd wrote:
> I'm looking for a way to launch BeanShell (or Groovy, either one will
> work for me) from Maven. My goal is to have an interactive scripting
> shell with a classpath containing all of my project's dependencies, and
> "target/classes" itself.
>
> I'm new to Maven, it's not something I can figure out how to do myself.
> I've searched the web for an example but there was a lot of noise in the
> results since Groovy uses Maven to build, and Maven supports(?) writing
> plugins in BeanShell.
>
> Has anyone done this? It seems like it would make a really useful maven
> plugin, since it would let you test ideas without writing experimental
> classes and launch scripts, etc.
>
> Thanks!
>
> -james
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org