#Java Gradle Submodule Compiling

1 messages ยท Page 1 of 1 (latest)

ornate patio
#

Basically I just want to compile all my modules in a single jar file.

muted zodiac
#

To create a single jar file containing all your modules, you can use the Gradle Shadow Plugin.

#

here's an an example of how to set it up in your parent build.gradle file @ornate patio (be aware that it might not work. Been long since I did this):

plugins {
    id 'java'
    id 'com.yourid' version '7.0.0'
}

group 'net.krisp'
version '1.0.0'

repositories {
    mavenCentral()
    mavenLocal()
}

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

subprojects {
    apply plugin: 'java'

    repositories {
        mavenCentral()
        mavenLocal()
    }

    dependencies {
        implementation project(':')
    }
}

shadowJar {
    baseName = 'RisenCore'
    version = null
    classifier = null

    subprojects.each { project ->
        from(project.sourceSets.main.output) {
            includeEmptyDirs = false
            into "modules/${project.name}"
        }
    }
}```
#

@ornate patio you here?

ornate patio
#

yeah

#

mbd

#

i was eating code

muted zodiac
#

Now worries lol, just making sure you saw it ๐Ÿ™‚

ornate patio
#

Can you give me the shadow plugin ?

muted zodiac
#

I gtg rn though, if you have any questions leave them here

muted zodiac
#

Just look up 'Gradel Shadow plugin' and youll find more info ๐Ÿ™‚

ornate patio
#

i mean the line to add in "plugin"

#

okay

muted zodiac
#

uhhh

ornate patio
#

ill check

muted zodiac
#

you're probably better off looking that up lol

ornate patio
#

hmm

#

yeah

#

I got a little prblm

#

I can't add any image ;/

#

okay nevermind i corrected it

#

tanks buud