Idea打包可运行的jar

jar {
    manifest {
        attributes("Manifest-Version": "1.0",
                "Main-Class": "Main");
    }
}

task fatJar(type: Jar) {
    manifest.from jar.manifest
    classifier = 'all'
    from {
        configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
    } {
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"
    }
    with jar
}

你可能感兴趣的:(Idea打包可运行的jar)