add-custom-task-to-subproject it is an example how you can create custom task with java code for subproject