创建自定义生成初始化类型 - 对于Gradle生成初始化插件? [英] Create custom Build init type - for Gradle Build Init Plugin?

查看:135
本文介绍了创建自定义生成初始化类型 - 对于Gradle生成初始化插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对gradle很新,我想用Gradle Init Plugin创建一个自定义类型。此外,我希望能够做到这样的事情:



gradle init --type jsp-library

这会生成一个与Java Web应用程序(webapp,stylesheets等)相同结构的项目目录。是的,我已阅读,并且我知道只有有限的几种类型可用。我只想知道,如果有人有或知道暂时的某种工作。

解决方案


  1. 有第三方插件允许您创建自定义模板并从模板生成新项目。例如,请参阅: https://github.com/townsfolk/gradle-templates


  2. 使用maven从archetype生成项目,然后使用gradle init将其转换为gradle项目。

  3. 自己修改init插件 source 添加更多初始化类型。

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. 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.

这篇关于创建自定义生成初始化类型 - 对于Gradle生成初始化插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆