0

When I build JAVA application as Artifact in IntelliJIdea it consists all needed libraries for the project. (Check picture-link)
Artifact JAR files

But when I build application with gradle - all needed libraries doesn't appear in JAR file. (Check picture-link)
Gradle JAR files

This is my gradle.build file

plugins {
    id 'java'
}

jar {
    manifest {
        attributes(
                'Main-Class': "Main"
        )
    }
}

group 'com.ZoneNewsDiscordBot'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    implementation "joda-time:joda-time:2.2"
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile 'net.dv8tion:JDA:4.2.0_214'

    //for JSON parsing
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.3'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.11.3'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.3'


    //for uploading pictures from Web Page
    compile group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.45.0'

    //for working with Instagram
    compile group: 'com.restfb', name: 'restfb', version: '3.13.0'
    implementation 'com.github.instagram4j:instagram4j:2.0.3'
    compile group: 'org.brunocvcunha.instagram4j', name: 'instagram4j', version: '1.14'

    task stage(dependsOn: ['build', 'clean'])
    build.mustRunAfter clean
}

Why this is happening? Where is all needed files?

  • [Here's the gist](https://gist.github.com/jdavidzapatab/1c974b5422aa5665c59cc6a6a7a91cc9) that does what you want to achieve. You can also try [gradle shadow plugin](https://imperceptiblethoughts.com/shadow/). – Sergei Nov 28 '21 at 23:24

0 Answers0