gradle project, jar package together with dependencies

def mainClassName = "package name + class name where the main method you need to execute is located"
jar {
    manifest {
        attributes "Main-Class": "$mainClassName"
    }

    from {
        configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

 

 

https://blog.csdn.net/chszs/article/details/69951839

 

https://www.jianshu.com/p/8ddb6c58ab26?mType=Group

 

https://www.cnblogs.com/yjmyzz/p/executable-jar.html

 

https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/gradle-plugin/reference/html/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326354584&siteId=291194637