# Groovy Library Sample

version 6.5

- Groovy DSL

- Kotlin DSL

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

If you are new to Gradle and wish to follow a more detailed tutorial for building Groovy libraries, we suggest you have an look at the Building Groovy Libraries guide.

This sample shows how a Groovy library can be built with Gradle. The library has no dependencies aside from the Groovy runtime and the build has minimal configuration.

build.gradle

    plugins {
        id 'groovy'
    }

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

    repositories {
        jcenter()
    }

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

build.gradle.kts

    plugins {
        groovy
    }

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

    repositories {
        jcenter()
    }

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

To build the library:

    $ ./gradlew jar

    BUILD SUCCESSFUL
    2 actionable tasks: 2 executed

For more information, see Groovy Plugin reference chapter.

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