Running an application

Report a typo

Suppose you have an amazing Gradle-based application.

Which one of the parts in the build.gradle file is responsible to make it runnable using the java -jar command?

You may need some experiments to solve this problem.

plugins {
    // ... here are other plugins ...

    // 1
    id 'application'
}

// 2
jar {
    manifest {
        attributes 'Main-Class' : 'path.to.EntryPoint'
    }
}

// 3
application {
    mainClassName = 'org.hyperskill.gradleapp.App'
}

// 4
repositories {
    jcenter()
}
Select one option from the list
___

Create a free account to access the full topic