apply plugin: 'java'

mainClassName = 'com.qxgmat.Application'

repositories {
    mavenLocal()
    maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
    mavenCentral()
}


dependencies {
    // shiro
//    compile(libraries."shiro-core", libraries."shiro-spring", libraries."shiro-cache")
    compileClasspath libraries."shiro"

    // druid
    compileClasspath 'com.alibaba:druid-spring-boot-starter:1.1.10'

    // swagger
    compileClasspath libraries."springfox-bean-validators", libraries."springfox-swagger2", libraries."springfox-swagger-ui"

    compileClasspath 'com.github.penggle:kaptcha:2.3.2'

    // https://mvnrepository.com/artifact/org.apache.poi/poi
    compileClasspath group: 'org.apache.poi', name: 'poi', version: '3.17'


//    compile group: 'commons-lang', name: 'commons-lang', version:'2.6'
//    compile group: 'commons-fileupload', name: 'commons-fileupload', version:'1.3.3'
//    compile group: 'commons-io', name: 'commons-io', version:'2.6'
//    compile group: 'commons-codec', name: 'commons-codec', version:'1.11'
//    compile group: 'commons-configuration', name: 'commons-configuration', version:'1.10'
}

bootJar {
    classifier = 'boot'

    // lib目录的清除和复制任务
    dependsOn clearJar
    dependsOn copyJar

    manifest {
        // Properties 允许加载扩展jar,是compileClasspath生效,定义在loader.properties
        // https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#executable-jar-launching
        attributes 'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher'
        attributes 'Start-Class': mainClassName
    }
    excludeDevtools = true
}

bootRun {
    dependsOn copyJar
    classpath +=files(fileTree(dir:"${libsDir}/lib/",include:['*.jar']))
//    jvmArgs = ["-Dloader.path=${libsDir}/lib", "-Dloader.debug=true"]
//    mainClassName = 'org.springframework.boot.loader.PropertiesLauncher'
}
//task runLocal(type: JavaExec) {
//    dependsOn bootJar
//    main="org.springframework.boot.loader.PropertiesLauncher"
//    args("-Dloader.path=${libsDir}/lib -Dloader.debug=true")
//}