jitpack.io icon indicating copy to clipboard operation
jitpack.io copied to clipboard

dependencies are not relocated when loading the repo into jitpack

Open Skjolberg opened this issue 2 years ago • 1 comments

Hello,

The repository compiles fine, there is no problem. The question is that I need to relocate a dependency and I use the shadowJar task, but jitpack doesn't seem to know which way the repo is compiling it so it ignores the task and doesn't relocate, is there any way to relocate a dependency when jitpack compiles the repo?

plugins {
    id("java")
    id("maven-publish")
    id("com.github.johnrengelman.shadow") version ("7.1.2")
}

group = "${project.property("group")}"
version = "${project.property("version")}"

plugins.apply("maven-publish")
plugins.apply("com.github.johnrengelman.shadow")

publishing {
    publications {
        create<MavenPublication>("maven") {
            groupId = "${project.group}"
            artifactId = project.name
            version = "${project.version}"

            from(components["java"])
        }
    }
}

repositories {
    mavenCentral()
    maven("https://jitpack.io")
    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

dependencies {
    implementation(libs.shibacraftApi)
    compileOnly(libs.spigot)
    compileOnly(libs.lombok)
    annotationProcessor(libs.lombok)
}

tasks {
    assemble {
        dependsOn(shadowJar)
    }
    java {
        toolchain {
            languageVersion.set(JavaLanguageVersion.of(8))
        }
    }
    withType<JavaCompile> {
        options.encoding = "UTF-8"
    }
    shadowJar {
        val relocate = "net.shibacraft.simpleblockregen.libs"
        relocate("net.shibacraft.api", "$relocate.shibacraftAPI")
        minimize()
    }
}

Skjolberg avatar Aug 26 '22 14:08 Skjolberg

solved

Skjolberg avatar Aug 26 '22 18:08 Skjolberg

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 26 '22 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 10 '22 02:10 github-actions[bot]