首页 > 代码库 > gradle发布jar包

gradle发布jar包

在.gradle文件中添加以下代码


apply plugin: ‘application‘

mainClassName = ‘com.excel.ExcelApplication‘

task deploy(type: Copy) {
    doFirst {
        println "cmd /c gradle clean".execute().text
        println "cmd /c gradle build -x test".execute().text
    }

    from configurations.runtime
    into "excelJar"

    from "build/libs/execl-1.0-SNAPSHOT.jar"
    into "excelJar"
}

[compileJava, compileTestJava]*.options*.encoding = ‘UTF-8‘

 

gradle发布jar包