Create custom Build init type - for Gradle Build Init Plugin?

我只是一个虾纸丫 提交于 2020-01-02 01:05:11

问题


I'm fairly new to gradle and I would like to create a custom type for with the Gradle Init Plugin. Moreover, I'd like to be able to do something like:

gradle init --type jsp-library

This would generate a project directory with the same structure as a Java web application (webapp, stylesheets, etc...). Yes, I have read this, and I know that only a limited amount of types are available. I just want to know if someone has or knows of some sort of work around for the time being.


回答1:


  1. There are 3rd party plugins that allow you to create custom templates and generate new projects from templates. For instance, see: https://github.com/townsfolk/gradle-templates

  2. Use maven to generate a project from archetype and then use gradle init to convert it to gradle project.

  3. Modify the init plugin yourself from source to add more init types.



来源:https://stackoverflow.com/questions/34856834/create-custom-build-init-type-for-gradle-build-init-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!