plugins {
    id 'org.springframework.boot' version '2.4.5'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
    id 'com.palantir.docker' version '0.19.2'
}

group = 'com.yn'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

def profileName = System.getProperty("profile") ?: "local"

repositories {
    mavenLocal()
    maven { url 'http://47.112.165.126:8889/nexus/content/repositories/public' }
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-data-redis'
    runtimeOnly 'mysql:mysql-connector-java'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
    implementation group: 'org.hibernate', name: 'hibernate-validator', version: '6.0.13.Final'
    implementation group: 'com.google.guava', name: 'guava', version: '30.1.1-jre'
    implementation group: 'com.github.xiaoymin', name: 'knife4j-spring-boot-starter', version: '3.0.3'
    implementation group: 'org.apache.shiro', name: 'shiro-core', version: '1.7.1'
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
    implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.76'
    compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-hibernate5', version: '2.9.8'
    implementation 'com.github.kuaidi100-api:sdk:1.0.2'
    implementation 'com.alipay.sdk:alipay-sdk-java:4.13.58.ALL'
    compile 'com.qiniu:qiniu-java-sdk:7.2.+'
    implementation group: 'org.springframework', name: 'spring-mock', version: '2.0.8'
    compile fileTree(dir:'lib',includes:['*jar'])
    compile 'org.springframework.boot:spring-boot-starter-amqp'
    compile group: 'com.yn', name: 'yn-byx-common-' + profileName, version: "0.0.1-SNAPSHOT"
    implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
    implementation 'joda-time:joda-time:2.12.2'
    // 当前腾讯云只引用语音识别的sdk，若有使用别的产品可单独使用，不必直接引用整个大包
    implementation("com.tencentcloudapi:tencentcloud-sdk-java-asr:3.1.820")
    // hutool工具包
    implementation 'cn.hutool:hutool-all:5.8.26'
    // poi
    implementation 'org.apache.poi:poi-ooxml:5.0.0'

}

test {
    useJUnitPlatform()
}

docker{
    dockerfile file('Dockerfile')
    name "182.44.68.187:8010/byx/yn-byx-thirdparty:1.0"
    files jar.archivePath
    buildArgs(['JAR_FILE': "${jar.archiveName}"])
}

configurations.all{
//每次build检查远程依赖是否存在更新
    resolutionStrategy.cacheChangingModulesFor 1,'seconds'
    resolutionStrategy.cacheDynamicVersionsFor 1,'seconds'
}
