1 Star 0 Fork 0

iorichina/hello-java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 3.05 KB
一键复制 编辑 原始数据 按行查看 历史
iorihuang 提交于 2023-07-13 09:23 . 更新gradle版本
buildscript {
repositories {
maven {
url "${mavenUrl}"
}
//jcenter()
mavenCentral()
}
}
allprojects {
apply {
plugin 'idea'
plugin 'eclipse'
plugin 'java'
plugin 'maven'
}
[compileJava, compileTestJava]*.options*.encoding = "UTF-8"
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
}
subprojects {
group 'iorichina.hellojava'
version '1.0-SNAPSHOT'
// sourceSets.main.java.srcDirs += ["src/gen/java"]
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
repositories {
maven {
url "${mavenUrl}"
}
//jcenter()
//本地依赖包路径
//flatDir {
// dirs '../../../../main/libs'
//}
//从中央库里面获取依赖
//mavenCentral()
//或者使用指定的本地maven 库
//maven{
// url "file://F:/githubrepo/releases"
//}
//或者使用指定的远程maven库
//maven{
// url "https://github.com/youxiachai/youxiachai-mvn-repo/raw/master/releases"
//}
mavenCentral()
}
configurations {
provided
compile.extendsFrom provided
//all*.exclude group: 'com.google.collections', module: 'google-collections'
// all*.exclude group: 'log4j', module: 'log4j'
// all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
// all*.exclude group: 'org.slf4j', module: 'slf4j-simple'
//all*.exclude module: 'javax.servlet'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
//jar.exclude '*.conf'
//jar.exclude 'spring-logback.xml'
dependencies {
//exclude something from any group
//compile (project(':CommonSDK')) { exclude group: "com.android.support" }
//单文件依赖
//compile files('libs/android-support-v4.jar')
//某个文件夹下面全部依赖
//compile fileTree(dir: 'src/android6/libs', include: ['*.jar'])
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
/*processResources << {
try {
file("$destinationDir/version.properties").text = 'version=' + "git rev-parse --short HEAD".execute().text.trim()
} catch (Exception e) {
println("get version from git fail")
}
}*/
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task copyLib(type: Sync, dependsOn: jar) {
from configurations.compile
from jar.archivePath
into 'build/deploy'
}
task deploy(dependsOn: copyLib) {
println jar.archivePath
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/iorichina/hello-java.git
git@gitee.com:iorichina/hello-java.git
iorichina
hello-java
hello-java
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385