# Groovy Application Sample

version 6.2.1

- Groovy DSL

- Kotlin DSL

| You can open this sample inside an IDE using the IntelliJ native importer or Eclipse Buildship.

This sample shows how to build a Groovy application with Gradle. The application has no dependencies aside from the Groovy runtime and the build has minimal configuration.

build.gradle

    plugins {
        id 'groovy'
        id 'application'
    }

    version = '1.0.2'
    group = 'org.gradle.sample'

    repositories {
        jcenter()
    }

    dependencies {
        implementation 'org.codehaus.groovy:groovy-all:2.5.7'
    }

    application {
        mainClassName = 'org.gradle.sample.Main'
    }

build.gradle.kts

    plugins {
        groovy
        application
    }

    version = "1.0.2"
    group = "org.gradle.sample"

    repositories {
        jcenter()
    }

    dependencies {
        implementation("org.codehaus.groovy:groovy-all:2.5.7")
    }

    application {
        mainClassName = "org.gradle.sample.Main"
    }

To build and run the application:

    $ ./gradlew run

    > Task :run
    Hello, World!

    BUILD SUCCESSFUL in 1s
    2 actionable tasks: 2 executed

For more information, see Application Plugin reference chapter.

You can also generate this project locally using `gradle init`.