Op Sat, 05 Sep 2015 08:56:09 +0200 schreef Barrie Treloar <[email protected]>:

I'm using the invoker plugin to test the mojo I'm hacking.

I had assumed that the mojo's classpath would be available to invoker, but
when I print out the classpath that doesn't appear to be the case.

"the mojo"? the mojo you are testing? No, that's just a standalone mojo. m-invoker-p just triggers it, it has no knowledge of the mojo it is executing. That's one of the reasons why MINVOKER-154 is still open.


[1] https://issues.apache.org/jira/browse/MINVOKER-154


I've tried the addTestClassPath option but then I'm getting
groovy.lang.GroovyRuntimeException: Failed to create Script instance for
class: class Script1. Reason: java.lang.ClassCastException: Script1 cannot
be cast to groovy.lang.GroovyObject

Already if you set addTestClassPath to true? Any chance you specified a different verion of groovy somewhere?


Which looks a bit like https://issues.apache.org/jira/browse/MINVOKER-112.

If I add in the dependency directly to the maven-invoker-plugin then I can
keep working.

What's the correct way?

The preferred way right now is adding the dependency as test-scoped to the maven-invoker-plugin. This should make it available for the scripts. I still want to support custom scopes for plugin dependencies, so you can easily specify when to use which dependency.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to