java lib 项目初始化 生成相关文件和文件目录
$ gradle init --type=java-library
java-library可替换为以下参数:
java-application
java-library
scala-library
groovy-library
basic
生成idea和eclipse的项目配置文件
#intellij idea 配置
$ gradle idea
#eclipse配置
$ gradle eclipse
#清除
$ gradle cleanIdea
$ gradle cleanEclipse
查看依赖树
$ gradle dependencies
移除依赖中的子依赖:
apply plugin: 'java' //so that I can declare 'compile' dependencies
dependencies {
compile('org.hibernate:hibernate:3.1') {
//excluding a particular transitive dependency:
exclude module: 'cglib' //by artifact name
exclude group: 'org.jmock' //by group
exclude group: 'org.unwanted', module: 'iAmBuggy' //by both name and group
}
}