How to create Gradle Multi-Project in IntelliJ


In this tutorial, we will take a look at how to create a Multi-Project in IntelliJ,

Step 1: Open IntelliJ IDE

Step 2: Menu: File -> New -> Project...

Make sure you choose Gradle Java Project, we will create a project with the name multi-proj-demo

New Gradle Project IntelliJ
Multi Project Name

Step 3: Menu: File -> New -> Module...

Again make sure you select Gradle and Java Project, we will call this module as utils,

Thats it, now you have a muti-project Gradle Java Project,

setting.gradle
rootProject.name = 'multi-proj-demo'
include 'utils'
build.gradle
plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
    useJUnitPlatform()
}
Build
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :utils:compileJava
> Task :utils:processResources NO-SOURCE
> Task :utils:classes
> Task :utils:compileTestJava NO-SOURCE
> Task :utils:processTestResources NO-SOURCE
> Task :utils:testClasses UP-TO-DATE
Advertisements
Try Out Code2care Dev Tools:

Advertisements

Advertisements
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.