I was also missing the dependency management plugi...
# spring
b
I was also missing the dependency management plugin
c
I think you also need spring milestone repository in
settings.gradle.kts
for plugin resolution.
b
yes I have both of them
Now it seems that I broke the full kotlin…
Plugin [id: 'org.jetbrains.kotlin.jvm'] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (plugin dependency must include a version number for this source)
c
Don't know why that error message, but not specifying version for kotlin plugin and specifying it for kotlin compiler plugins can lead to a conflict. Those need to be in sync.
kotlin("jvm") version kotlinVersion
b
it is because it is a subproject
so it explicitly tells me not to put it
the main build.gradle.kts has a version
kotlin("jvm") version "1.3.30"
maybe my settings.gradle is overwriting some default plugin repository?
c
plugins
block must be specified in the root project
in subprojects you just apply the plugins
b
pluginManagement { repositories { maven { url 'https://repo.spring.io/snapshot' } maven { url 'https://repo.spring.io/milestone' } gradlePluginPortal() } resolutionStrategy { eachPlugin { if (requested.id.id == 'org.springframework.boot') { useModule("org.springframework.bootspring boot gradle plugin${requested.version}") } if (requested.id.id == "kotlin-multiplatform") { useModule("org.jetbrains.kotlinkotlin gradle plugin${requested.version}") } if (requested.id.id == "kotlinx-serialization") { useModule("org.jetbrains.kotlinkotlin serialization${requested.version}") } } } }
yep well it used to work before I changed to the 2.2.0
so clearly there is something I did that is not right
c
if you do not need a plugin in root project but only need it in sub, you define it with
apply false
in the root project and apply in subprojects where necessary
b
I'm talking about kotlin here…
If I don't have kotlin("jvm") in my sub project, I can't even get gradle to load my build.gradle.kts
so my hypothesis now is that I messed up something in the settings.gradle
c
your setup seems not correct to me, I've explained why, if you think I'm wrong, well good luck, I can't help 🙂
b
I don't understand what is wrong from what you said
I have : plugins { kotlin("jvm") version "1.3.30" apply false } in my base project
plugins { kotlin("jvm") } in my sub projects.
(with additional plugins when needed
I removed stuff I had on the base project that I was not using so now I was able to "apply false" the plugin on the base project. And now it works
but I don't really get why
aren't they supposed to all use the same version?
it seems that removing the dokka tasks I had in the root project is what made it work (removing the apply false still make the project compile)
c
what version of gradle are you working on? apparently I lag behind a bit and
plugins {}
blocks are now supported in subprojects
b
latest included with the EAP intelliJ
4.10 maybe
c
that's important, check please, 4.10 is a dinosaur in terms of kotlin-dsl support
you can run
./gradlew -version
b
nevermind 5.2.1
I have various projects working with Boot 2.2.0.M2 and Gradle Kotlin DSL
b
yep looks like what I have
it works now
c
Ok, with that plugins are specified like this: * in root project you specify all plugins which are to be used in the build, including all the plugins only subprojects will use * those plugins that are not needed in the root project you specify with
apply false
* in subprojects you specify the plugins that need to be applied without version * buildscript with repository you have in the snippet in theory does nothing and can be removed.
s
Oh ok
What was missing?
b
I have no idea
just disabling dokka and its task in the root module seems to have made it
I didn't need it anyway there…
s
Oh Dokka is another thing
Let me find the link
b
@Czar Ok I'll move all my modules down at root then
Dokka 0.9.18 now requires additional repositories, see the thead for more details
Not sure if that's related but worth to know
I hope they will change that confusing requirement
Gradle Kotlin DSL will be shortly supported on start.spring.io
b
I switched to orchid to generate my docs anyway so I don't use dokka directly anymore
it was an old remnant
Now that I moved spring boot plugins declaration to the root
it cannot find the right versions in the submodule…
I'll compare with your spring-fu
see what I missed
what is that: imports { mavenBom("org.springframework.bootspring boot dependencies$bootVersion") }
s
Spring Fu is not a Boot app itself so that's not relevant for your use case
b
I'm completely lost now
I tried to move the plugins to the root project
but now it cannot find spring boot for the subprojects
s
I think the easier way for others to help you is to share the structure of your project in a repo
Otherwise it will be frustrating for everybody
yeah I'll make a repo
I moved the repositories back to the root project
s
Thanks I will have a look later (currently away from keyboard)
b
thx
I'll continue working on it and updating the repo
ok I forgot to include the plugin in the subprojects
sorry for the disturbance…
I really have a hard time wrapping my head around gradle
and thanks both of you for the help!
s
So that works now?
b
YES ! \o/