1

There is a GitLab Community Edition 15.11.3 server in which the artifacts of our java libs are stored in the package registry (lib-name.jar, lib-name.sources.jar, lib-name.javadoc.jar) There are projects that, through build.gradle, pull our libs from gitlab, everything is ok, everything works:

plugins {
    id 'java'
    id 'idea'
}

repositories {
    maven {
        url "https://gitlab.server.com/api/v4/groups/maven/-/packages/maven"
        name "GitLab"
        credentials(HttpHeaderCredentials) {
            name = gradle.vcsAuthHeader
            value = gradle.vcsAccessToken
        }
        authentication {
            header(HttpHeaderAuthentication)
        }
    }
}

dependencies {
    implementation 'com.google.guava:guava:31.1-jre'
    implementation 'org.company.tool:lib-name:0.0.1'
}

But lib-name.sources.jar and lib-name.javadoc.jar are not pulled up, but only lib-name.jar, while sources and javadoc are easily pulled up from any other sources. Sources are pulled from the github, ours, if we put them in the nexus, any other libs from the maven repositories.

For example, when working with the guava library, I see both sources and javadocs in the gradle cache and, accordingly, intellij IDEA automatically pulls all this up for them, but not for our libs.

Tried different versions of Gradle, from old to latest, doesn't help.

What could be the problem?

Updates:

Will add sources jar to my application's classpath. It's not what I would like:

    implementation 'org.company.tool:lib-name:0.0.1:sources'

Does not help:

idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}
Alexey Bril
  • 479
  • 4
  • 14
  • Pulled to where exactly? – aled May 31 '23 at 18:30
  • @aled to the project where build.gradle is located – Alexey Bril May 31 '23 at 18:35
  • Does this answer your question? [How to download javadocs and sources for jar using Gradle 2.0?](https://stackoverflow.com/questions/28404149/how-to-download-javadocs-and-sources-for-jar-using-gradle-2-0) – aled May 31 '23 at 18:37
  • @aled no, I've seen these answers and the given solutions don't help. The problem is in gitlab, from other package registries, sources for jar are downloaded – Alexey Bril May 31 '23 at 18:42
  • Why do you need to download the sources&Javadoc of a dependency? I would understand for an IDE it is useful for reference when editing. Why outside the IDE? – aled May 31 '23 at 18:44
  • @aled this is necessary for the prompt in the IDE when editing the project and for other package registries it works out of the box – Alexey Bril May 31 '23 at 18:49
  • Why the solution for that didn't work? https://stackoverflow.com/a/33653146/721855 – aled May 31 '23 at 19:00
  • @aled With the option in this question, the library resources are not pulled from the gitlab. They are not in the gradle cache. There is no way to use javadoc, since I am essentially working with source code that is recreated from a .class file using IntelliJ IDEA. – Alexey Bril May 31 '23 at 19:12

0 Answers0