加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.57 KB
一键复制 编辑 原始数据 按行查看 历史
Yuya Ebihara 提交于 2021-01-12 10:39 . Migrate to Spring Boot (#279)
apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'checkstyle'
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'com.adarshr.test-logger'
version = '22.0'
repositories {
mavenCentral()
maven { url "http://repo.hortonworks.com/content/repositories/releases" }
maven { url "http://repo.hortonworks.com/content/groups/public" }
maven { url "http://oss.sonatype.org/content/groups/public/" }
maven { url "https://plugins.gradle.org/m2/" }
}
compileJava.options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
checkstyle {
configFile = file("$project.rootDir/config/checkstyle/checkstyle.xml")
toolVersion = "8.29"
showViolations = true
ignoreFailures = false
maxWarnings = 0
}
task createDirs() {
file('build/package').mkdirs()
}
task buildWeb(type:Exec) {
workingDir './web'
commandLine './deploy.sh'
standardOutput = new ByteArrayOutputStream()
ext.output = {
return standardOutput.toString()
}
}
task copyWeb(type: Copy) {
from('web/dist')
into('build/package/web')
}
task copyDeps(type: Copy) {
from(configurations.compile)
into('build/package/lib')
}
task copyLibs(type: Copy, dependsOn: 'jar') {
from('build/libs')
into('build/package/lib')
}
task copyPackage(type: Copy) {
from('src/package')
into('build/package')
}
task copyConfig(type: Copy) {
from('src/main/resources/config')
into('build/package/config')
}
task copyData(type: Copy) {
from('data')
into('build/package/data')
}
task copyResult(type: Copy) {
from('result')
into('build/package/result')
}
task copy(dependsOn: [
'createDirs',
'buildWeb',
'copyWeb',
'copyDeps',
'copyLibs',
'copyPackage',
'copyConfig',
'copyData',
'copyResult']) {
}
distributions {
main {
baseName = 'yanagishima'
contents {
from { 'build/package' }
}
}
}
tasks.withType(JavaCompile).configureEach {
options.errorprone {
error('MissingOverride', 'ClassCanBeStatic', 'ArrayToString', 'RemoveUnusedImports')
disable('JavaTimeDefaultTimeZone', 'UnusedVariable', 'UnusedMethod', 'FutureReturnValueIgnored', 'StringSplitter')
}
}
distZip.dependsOn 'copy'
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.1.1"
classpath "com.adarshr:gradle-test-logger-plugin:2.1.1"
}
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.10'
compile 'org.slf4j:slf4j-log4j12:1.7.10'
compile 'com.facebook.presto:presto-client:0.215'
compile 'io.prestosql:presto-client:347'
compile 'io.prestosql:presto-parser:347'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'org.apache.httpcomponents:fluent-hc:4.4.1'
compile 'org.xerial:sqlite-jdbc:3.20.1'
compileOnly 'org.projectlombok:lombok:1.18.8'
annotationProcessor 'org.projectlombok:lombok:1.18.8'
compile 'org.komamitsu:fluency:1.7.0'
compile 'org.apache.hive:hive-jdbc:1.2.1000.2.5.3.0-37'
compile 'org.apache.hadoop:hadoop-common:2.7.3.2.5.3.0-37'
compile 'org.apache.commons:commons-csv:1.5'
compile 'com.google.guava:guava:30.1-jre'
compile 'com.github.wyukawa.elasticsearch.unofficial.jdbc.driver:elasticsearch-jdbc-driver:0.0.9'
compile 'org.jsoup:jsoup:1.11.3'
compile 'mysql:mysql-connector-java:5.1.47'
compile 'org.springframework.boot:spring-boot-starter-web:2.3.5.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-jetty:2.3.5.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-data-jpa:2.3.5.RELEASE'
compile 'org.springframework.boot:spring-boot-autoconfigure:2.3.5.RELEASE'
compile 'io.springfox:springfox-swagger2:2.9.2'
compile 'io.springfox:springfox-swagger-ui:2.9.2'
errorprone 'com.google.errorprone:error_prone_core:2.3.4'
// For tests
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.0"
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.7.0"
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.3.5.RELEASE'
testCompile 'com.h2database:h2:1.4.200'
testCompile 'org.mockito:mockito-core:2.23.4'
testCompile 'org.assertj:assertj-core:3.18.1'
}
test {
useJUnitPlatform()
}
configurations {
all {
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'com.google.code.gson', module: 'gson'
exclude group: 'org.eclipse.jetty.aggregate', module: 'jetty-all'
exclude group: 'javax.servlet', module: 'servlet-api'
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化