Thanks for the hints. For the record, here is my solution:
- Added dependency org.apache.maven:maven-project
- Added a field of type org.apache.maven.execution.RuntimeInformation to my
Mojo and marked it as a @component (in JavaDoc)
- Retrieved the version number with
runtimeInformation.getApplic
Because my plugin (spock-maven) doesn't work with Maven 3, I'd like to fail
the build if it used with Maven 3. (Otherwise it will be very hard for users
to find out the cause of the effect they are seeing.) How can I detect which
Maven version my plugin gets run with? Can't find any information on
any information on this.
Cheers,
Peter
PS: I'm posting to dev because I didn't get any replies on the user list.
----
Peter Niederwieser
Creator, http://spockframework.org
Committer, http://groovy.codehaus.org
Blogger, http