Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute external groovy script from Maven

Tags:

maven

groovy

I have a maven project with nothing related to groovy in pom.xml. And I just want to execute a groovy script test.groovy in the root of my project with access to all project's classes.

so I try to run an command:

mvn groovy:execute -Dsource=test.groovy

but it tells me that:

[ERROR] Failed to execute goal org.codehaus.mojo:groovy-maven-plugin:1.5:execute (default-cli) on project modules-journal:
The parameters 'source' for goal org.codehaus.mojo:groovy-maven-plugin:1.5:execute are missing or invalid -> [Help 1]

what is wrong?

mvn groovy:shell works perfectly, but I want to run predefined script.

like image 553

1 Answers

It fails with groovy-maven-plugin in version 1.5, but it works great with version 2.0.

like image 51
Alien11689 Avatar answered Feb 02 '26 20:02

Alien11689



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!