Idea don't download sources for dependencies in the multibuild project( with buildSrc)

Hi) I have problem when I try to download sources from IntellijIdea.

The project structure is:
rootProj:

  • buildSrc
  • mainProjects:
    • project1
    • project2
  • utils

I got the error next:

Build file ‘\path\rootProj\mainProjects\project1\build.gradle.kts’ line: 1

Plugin [id: ‘my.org.common-plugin’] was not found in any of the following sources:

** Try:*
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

build.gradle.kts:

plugins {
    id("my.org.common-plugin")
}

defaultTasks("clean", "smoke")

dependencies {
   ...
}

Could you help to download sources?

Hello @vwassa

gradle try to download a plugin my.org.common-plugin from the gradle plugin repositry but this plugin is not exist

so make sure to write the correct plugin you need or this a custom plugin ?

hope that help and have a nice day :slight_smile:

Thanks, Yes it is, the plugin is from buildSrc(Organizing Gradle Projects) directory and is convention plugin(Sharing build logic between subprojects Sample) So I don’t understand why is it problem to get sources from buildSrc?)

are you sure that there file called my.org.common-plugin.gradle.kts in the following path
buildSrc/src/main/kotlin/

i assume you use kotlin

hope that help and have a nice day :slight_smile:

Yep, I’m using kotlin + kotlin dsl and path is right) And file extension is .gradle.kts.
I don’t have problem then build and run test. Only then trying to download sources from Intellij idea.
I tried to use the idea plugin:

idea {
    module {
        isDownloadJavadoc = false
        isDownloadSources = true
    }
}

and it don’t help to solve problem.
I don’t know other technique to download code sources from gradle.

Can you share build.gradle content from buildSrc directory?
And what do you mean exactly with download sources?

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    alias(libs.plugins.kotlin.jvm)
    `kotlin-dsl`
}

afterEvaluate {
    val kotlinApiVersionFromLibsVersionCatalog = libs.versions.kotlin.get().substringBeforeLast(".")

    tasks.withType<KotlinCompile>().configureEach {
        kotlinOptions {
            apiVersion = kotlinApiVersionFromLibsVersionCatalog
            languageVersion = kotlinApiVersionFromLibsVersionCatalog
        }
    }
}
kotlin {
    val projectJVMVersion: String by project

    jvmToolchain {
        (this as JavaToolchainSpec)
            .languageVersion
            .set(JavaLanguageVersion.of(projectJVMVersion))
    }
}

tasks {
    withType<JavaCompile>().configureEach {
        enabled = false
    }
    withType<GroovyCompile>().configureEach {
        enabled = false
    }
}

dependencies {
    api(enforcedPlatform(libs.kotlin.bom))
    api(libs.bundles.buildSrc.kotlin)
    implementation(libs.bundles.allure)
    implementation(libs.test.retry)
}

image

sorry for late replay but i do not know and hope other help you and have a nice day :slight_smile: