Type: New Feature
Affects Version/s: 2.11
Fix Version/s: None
Component/s: Maven Surefire Plugin
Number of attachments :
I would like to integrate Gosu-based tests into the Surefire plugin. Gosu is a JVM-based programming language. It is compiled with a slightly different model than java: rather than shipping class files, it ships source files and compiles them on-demand, more like scripting languages such as JRuby.
We are developing a maven plugin that wires in gosu support for maven here:
As you can see, it adds POM dependencies to the core gosu jars, providing gosu support. I'd like to extend this plugin to direct surefire how to detect and run Gosu-based tests.
Investigating the surefire plugin code, it looks like what I need to do is specify a custom DirectoryScanner. I have two questions on this (and I apologize, I am very new to Maven, but could not find how to do this via the documentation):
1) Can I specify a custom scanner from the command line? That would get me started writing my scanner.
2) Is there an API in Maven for automatically setting properties (or does it use the standard System properties API) such that I could pass this custom DirectoryScanner along programmatically from our maven plugin?
In a private email, Kristian mentioned the following issue:
"There is one more hurdle you will need to solve, and that's how to add the Gosu stuff to the classpath of the fork. I suppose you should add them as dependencies to the surefire-plugin, but there is currently no automatic way to transfer these to the fork."
I'm hoping that the fact that we add the dependencies to the parent POM solves this problem (I assume that this is how other libraries are included in surefire tests) but I do not understand the Maven dependencies and classloader setup well enough to know for sure. I'll need to experiment.