gradle eclipse web模板项目构建
来源:互联网 发布:电脑usb001端口是哪个 编辑:程序博客网 时间:2024/04/27 05:01
1.gradle 自带插件不支持web项目骨架创建,必须要用到第三方gradle模板插件.
在gradle 安装目录下的init.d目录下新建文件init.gradle,添加脚本:
gradle.beforeProject { prj ->
prj.apply from: 'http://www.tellurianring.com/projects/gradle-plugins/gradle-templates/apply.groovy'
}
保存后,用gradle tasks在命令行窗口查看gradle初始化任务就会在原来的基础上新增如下任务:
Template tasks
--------------
createGradlePlugin - Creates a new Gradle Plugin project in a new directory named after your project.
createGroovyClass - Creates a new Groovy class in the current project.
createGroovyProject - Creates a new Gradle Groovy project in a new directory named after your project.
createJavaClass - Creates a new Java class in the current project.
createJavaProject - Creates a new Gradle Java project in a new directory named after your project.
createScalaClass - Creates a new Scala class in the current project.
createScalaObject - Creates a new Scala object in the current project.
createScalaProject - Creates a new Gradle Scala project in a new directory named after your project.
createWebappProject - Creates a new Gradle Webapp project in a new directory named after your project.
exportAllTemplates - Exports all the default template files into the current directory.
exportGroovyTemplates - Exports the default groovy template files into the current directory.
exportJavaTemplates - Exports the default java template files into the current directory.
exportPluginTemplates - Exports the default plugin template files into the current directory.
exportScalaTemplates - Exports the default scala template files into the current directory.
exportWebappTemplates - Exports the default webapp template files into the current directory.
initGradlePlugin - Initializes a new Gradle Plugin project in the current directory.
initGroovyProject - Initializes a new Gradle Groovy project in the current directory.
initJavaProject - Initializes a new Gradle Java project in the current directory.
initScalaProject - Initializes a new Gradle Scala project in the current directory.
initWebappProject - Initializes a new Gradle Webapp project in the current directory.
新建一个空目录,然后在下面直接输入gradle initWebappProject后就会生成web项目骨架,如果是要构建java web项目,只要在生成的build.gradle下应用java插件即可
2.将生成的web项目模板导入eclipse.模板生成命令生成的原始骨架是不支持eclipse导入的,要想项目能够导入到eclipse中,我们还要在build.gradle中应用eclipse或eclipse-wtp插件.eclipse 插件成功应用后,运行任务gradle eclipse就会生成一些eclipse的配置文件,项目就变成了eclipse项目.
3.每次编辑build.gradle 脚本添加以来后,执行gradle eclipse即可下载依赖,并添加到classpath中来
- gradle eclipse web模板项目构建
- Eclipse构建gradle项目
- Gradle构建web项目
- Eclipse中使用Gradle构建Java Web项目
- 使用Gradle构建web项目
- 搭建gradle web项目模板
- eclipse 构建web 项目
- eclipse下利用gradle构建项目
- gradle eclipse下构建ssh2项目
- Jetty(一)Gradle构建web项目
- MyEclipse 使用gradle 构建java web项目
- Maven构建Web项目(eclipse)
- Eclipse+Maven构建Web项目
- Eclipse+Maven构建Web项目
- Eclipse构建maven web项目
- Eclipse构建Maven web项目
- eclipse maven构建web项目
- Eclipse构建maven web项目
- java静态代码块、初始化块和构造方法的执行顺序
- 2817:木棒 【递归+剪枝】
- 【Oracle】无宕机迁移更换asm磁盘
- Java String之intern()方法深入分析
- exej4打包jar图文教程
- gradle eclipse web模板项目构建
- 3.0创建mongoDB客户端链接
- 2,XCode的快捷键
- 剑指offer之65 滑动窗口的最大值问题
- Andrid的网络开发技术
- 3.0MongoDB对一个collection的常用操作
- leetcode-Remove Linked List Elements
- 汉字转拼音
- B - 四月纲领 light oj 1245【数论】