vwassa
(Zi)
September 14, 2022, 8:39am
#1
Hi) I have problem when I try to download sources from IntellijIdea.
The project structure is:
rootProj:
buildSrc
mainProjects:
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?
justsomeone
(justsomeone)
September 15, 2022, 5:51am
#2
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
vwassa
(Zi)
September 15, 2022, 6:54am
#3
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?)
justsomeone
(justsomeone)
September 15, 2022, 8:08am
#4
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
vwassa
(Zi)
September 15, 2022, 8:55am
#5
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.
rivancic
(Renato Ivancic)
September 15, 2022, 12:08pm
#6
Can you share build.gradle
content from buildSrc
directory?
And what do you mean exactly with download sources?
vwassa
(Zi)
September 15, 2022, 1:26pm
#7
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)
}
justsomeone
(justsomeone)
September 16, 2022, 1:18pm
#8
sorry for late replay but i do not know and hope other help you and have a nice day
Vampire
(Björn Kautler)
September 27, 2022, 7:17pm
#9
Can you provide an MCVE ? I think it is not fully clear what the setup is. The idea { module { ... } }
configuration you mentioned should be irrelevant I think. Iirc it is only relevant if you use the tasks starting with idea
which you should not do.