What is convinience way in gradle to compile rmi stubs during building java project?
You can use the ‘rmic’ Ant task. Although, with Java 1.5 or higher, RMI stubs are typically generated at runtime, and it is no longer necessary to generate them manually.
Thanks you, i don listen about this feature)
When we are trying to get rid of ant by using gradle, asking to use ant task(pull in all ant jar) in gradle is not the best answer.
Gradle ships with ant and reusing the wide range of available ant task in a gradle build is a common pattern. The original question was not about replacing ant it was a convenient way to go. And the most convenient way is indeed reusing the rmic ant task as suggested by Peter.
Alternatively you can use the Exec task to trigger ‘rmic’ directly. Have a look at the DSL reference for the Exec task for the details: http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.Exec.html
It’s perfectly fine to use Ant tasks from Gradle. You’ll still get all of Gradle’s other benefits. Fact is there are many third-party Ant-based tool integrations out there. Also, Gradle can’t possibly support each (legacy) feature under the sun. If you think it’s worthwhile to have native support for generating RMI stubs (why don’t you generate them at runtime?), consider giving back and write/publish a Gradle plugin.