bulid.gradle:
更多内容参考:https://www.cnblogs.com/gzdaijie/p/5296624.html
http://www.cnblogs.com/gzdaijie/category/798374.html
https://docs.gradle.org/current/userguide/dependency_management_for_java_projects.html
http://wiki.jikexueyuan.com/project/gradle/dependency-management-basics.html
http://gradledoc.qiniudn.com/1.12/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html
https://waynell.github.io/2015/04/13/gradle-use-03/
group '[包名]'
version '[版本]'
buildscript {
repositories {
mavenCentral()
}
}
apply plugin: 'java'
sourceCompatibility = [语言版本]
targetCompatibility = [语言版本]
repositories {
mavenCentral()
}
sourceSets {
main.java.srcDirs += '[源代码目录]'
test.java.srcDirs += '[测试代码目录]'
}
dependencies {
compile group: '[依赖的包名]', name: '[依赖的名称]', version: '[依赖版本]'
testCompile group: '[测试代码依赖的包名]', name: '[测试代码依赖的名称]', version: '[版本]'
compile ('com.donghua.test-common:6.17.0') {
changing = true //表示从库中拉最新代码,如果有人提交当前模块的jar而名字没变,不然会从缓存中拉
exclude group: 'javax.servlet'
exclude group: 'javax.servlet.jsp'
exclude group: 'org.apache.axis'
}
}