Install groovysh path class from pom

I have a java project (without using groovy), but I would like to play interactively with my java classes in groovysh. Is there an easy way to use pom from my project to install the gropathysh classpath?

+3
source share
3 answers

MOP can help:

Scripts Pros

In other cases, you just need CLASSPATH so that you can use it in the manually created script your launch. Try it.

mop classpath org.apache.camel:camel-example-pojo-messaging

Update: The above command can be used to output the classpath of an existing maven artifact. For instance:

$ ./mop classpath org.hibernate: hibernate-core: 3.3.2.GA

Prints the following output:

/home/pascal/opt/mop/repository/org/hibernate/hibernate-core/3.3.2.GA/hibernate-core-3.3.2.GA.jar:/home/pascal/opt/mop/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar:/home/pascal/opt/mop/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:/home/pascal/opt/mop/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/pascal/opt/mop/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/home/pascal/opt/mop/repository/javax/transaction/jta/1.1/jta-1.1.jar:/home/pascal/opt/mop/repository/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar

- . , , 100% , (, ).

+3

, , gmaven-plugin: mvn groovy:shell, , groovysh, , !

+7

You can add them to the classpath using -cpfor example.

groovysh -cp some.jar:another.jar
+1
source

Source: https://habr.com/ru/post/1744036/


All Articles