从Maven执行外部groovy脚本 [英] Execute external groovy script from Maven
本文介绍了从Maven执行外部groovy脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 pom.xml
中有一个 maven 项目,其中没有任何与 groovy 相关的项目。我只想在我的项目的根目录下执行一个groovy脚本 test.groovy
,并可以访问所有项目的类。
所以我尝试运行一个命令:
mvn groovy:execute -Dsource = test.groovy
但它告诉我:
[错误]未能执行目标org.codehaus.mojo:groovy-maven-plugin:1.5:对项目modules-journal执行(默认-cli)
目标组织的参数'source'。 codehaus.mojo:groovy-maven-plugin:1.5:执行失踪或无效 - > [帮助1]
有什么不对?
< 它在1.5版本中无法使用groovy-maven-plugin,但它在2.0版本中效果很好。
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.
解决方案
It fails with groovy-maven-plugin in version 1.5, but it works great with version 2.0.
这篇关于从Maven执行外部groovy脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文