jitpack / jitpack.io

Documentation and issues of https://jitpack.io
MIT License
2.51k stars 183 forks source link

(Gradle) Javadoc does not get uploaded to Jitpack #6410

Closed Luncaaa closed 4 days ago

Luncaaa commented 1 month ago

I'm using Gradle subprojects and I would like to upload only one of the subprojects along with the Javadocs for that subproject. The project itself is uploaded correctly and I can use the API from other projects, but the Javadocs aren't uploaded. My build.gradle.kts for the module I want to upload:

plugins {
    id("java")
    id("maven-publish")
}

tasks {
    javadoc {
        title = "TagGame API " + project.version
        options {
            (this as StandardJavadocDocletOptions).apply {
                windowTitle = "TagGame API"
                links = listOf("https://hub.spigotmc.org/javadocs/spigot")
            }
        }
    }

    register<Jar>("makeJavadoc") {
        dependsOn(javadoc)

        archiveClassifier.set("javadoc")
        description = "Creates a Javadoc Jar"
        from(javadoc.get().destinationDir)
    }

    jar {
        dependsOn("makeJavadoc")
        finalizedBy(publishToMavenLocal)
    }
}

publishing {
    publications {
        val mavenJava by creating(MavenPublication::class) {
            from(components["java"])
        }
    }
}

artifacts {
    archives(tasks.jar)
    archives(tasks.named("makeJavadoc"))
}

My jitpack.yml

install:
  - ./gradlew :api:jar

The generated logs: https://jitpack.io/com/github/Luncaaa/Tag-Game-MC/main-6c97388b9f-1/build.log

As you can see at the end of the logs, the compiled JAR is uploaded but the javadocs aren't. Running the jar command locally generates both the compiled jar and the api-javadoc.jar file.

What am I doing wrong?

github-actions[bot] commented 2 weeks ago

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

jitpack-io commented 2 weeks ago

Hi

JitPack takes artifacts from $HOME/.m2/repository folder. Would recommend checking if the sources.jar gets copied there.

github-actions[bot] commented 4 days ago

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