Generate JAR with external dependencies in another folder


(Renato G.) #1

Hi,
I have a doubt to generate Jar with a a dependencies in external folder,
because my executable jar is so fat.

If someone can help me I’ll be grateful

My Actual build.gradle

   jar { 
    baseName = 'Executable'
    version = "1.0"
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    manifest { 
        attributes 'Implementation-Title': 'COM PAF',
                'Implementation-Version': version,
                'Built-By': System.getProperty('user.name'),
                'Built-Date': new Date(),
                'Built-JDK': System.getProperty('java.version'),
                'Main-Class': 'com.app.MainApp'
        
    } 
    doFirst {
        from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } 
    }
    exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' 
}