gradle多工程依赖

多工程依赖:http://blog.csdn.net/w8452960/article/details/53415415

https://www.cnblogs.com/softidea/p/4525236.html

打jar包

jar {
from {
//添加依懒到打包文件
//configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtime.collect{zipTree(it)}
}
manifest {
attributes 'Main-Class': 'Greeter'

}
}

 打jar包

jar {
    manifest {
        attributes('Implementation-Title': project.name,    名字
                   'Implementation-Version': project.version)   版本号
    }
}
=======================================
将java文件夹中的资源文件打到 resources中。
processResources {
from('src/main/java') {
include '**/*'
exclude '**/*.java'
}
}


========================================================
subprojects {
// apply plugin: 'java'
//// apply plugin: 'eclipse'
// apply plugin: 'idea'
//
// version = '1.0'

dependencies{
// compile project('common')
compile(
'org.apache.httpcomponents:httpmime:4.5.4',
'com.alibaba:fastjson:1.2.41',


子工程依赖,前面要填上适用的插件。否者提示:
Could not find method compile() for arguments [org.apache.httpcomponents:httpmime:4.5.4, com.alibaba:fastjson:1.2.41, log4j:log4j:1.2.17, org.jdom:jdom:2.0.2, com.google.zxing:core:3.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
原文地址:https://www.cnblogs.com/liyafei/p/8436719.html