#Java Gradle with submodules

4 messages · Page 1 of 1 (latest)

quaint pasture
#

Okay ! (This is gradle stuff, so if you've never used gradle please pass your way)

So I try to create a "parent module" which will use sub modules (depend on the server version), but I can't compile correctly !

So here's my structure
RisenCore (parent module)

  • src (parent src with all the stuff no depend on the child modules)
  • build.gradle
  • module1
    • build.gradle (dependence on parent module)
  • module2
    • build.gradle (dependence on parent module)

So I want to compile all that stuff in a single jar file.

But when I compile with the jar task from the parent build.gradle it compile only the "parent", I would like to compile the whole stuff

So here's my 3 build.gradle
(parent)

plugins {
    id 'java'
}

group 'net.krisp'
version '1.0.0'

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    compileOnly 'org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT'
}


setLibsDirName("../exports")

module1

plugins {
    id 'java'
}

group 'net.krisp'
version '1.0.0'

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    implementation project(path: ':')
    compileOnly 'org.spigotmc:spigot:1.8-R0.1-SNAPSHOT'
}

module2

plugins {
    id 'java'
}

group 'net.krisp'
version '1.0.0'

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    implementation project(path: ':')
    compileOnly 'org.spigotmc:spigot:1.8.3-R0.1-SNAPSHOT'
}

Thanks again for reading 😭

I've register modules in settings.gradle by using includes 'module1', etc...

chrome pathBOT
#

This post has been reserved for your question.

Hey @quaint pasture! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

quaint pasture
#

Ping me ! Thanks