# Multi-project build (JVM) Sample

version 6.6.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 use dependencies within a JVM multi-project build in Gradle. This is the same pattern used by all JVM languages (Java, Groovy, Scala).

The `application` project has an implementation dependency on the `utilities` project:

application/build.gradle

    plugins {
        id 'application'
    }

    dependencies {
        implementation project(':utilities')
    }

    application {
        mainClass = 'org.gradle.sample.app.Main'
    }

application/build.gradle.kts

    plugins {
        application
    }

    dependencies {
        implementation(project(":utilities"))
    }

    application {
        mainClass.set("org.gradle.sample.app.Main")
    }

Which in turn has an API dependency on the `list` project:

utilities/build.gradle

    plugins {
        id 'java-library'
    }

    dependencies {
        api project(':list')
    }

utilities/build.gradle.kts

    plugins {
        `java-library`
    }

    dependencies {
        api(project(":list"))
    }

To build the projects, you simply need to build the application:

    $ ./gradlew :application:run

    > Task :application:run
    Hello, World!

    BUILD SUCCESSFUL
    6 actionable tasks: 6 executed

For more information, see dependency management chapters.