Can I run maven plugin goal from Gradle?

I have a custom maven plugin which has some important code generation technique. I want to invoke maven goal via Gradle to trigger this code generation. Of course I can write maven goal itself in Groovy script, but we want to support both Maven and Gradle for some time.

I could not find any way to achieve this. Please let me know if there a way to do this.

Thanks, Abhijith

There is no way to directly invoke a Maven goal from Gradle. You can either shell out to Maven, or port the Maven Mojo to a Gradle task/plugin.

Can anyone provide a Sample example to work on Gradle ?