Hi there! I'm using the Kotlin DSL with Gradle and...
# intellij
a
Hi there! I'm using the Kotlin DSL with Gradle and a Kotlin multiplatform project in IntelliJ and I'm always struggling when I add new dependencies to my project. What is the right way to add new (Maven) dependencies? What happens is that whenever I add a new one and build the project from the CLI it works but I can't see the new dependency in the
External Dependencies
list in the Project sidebar in IntelliJ. What am I doing wrong? Even if I run
gradle clean assemble
from the IDE it still doesn't get updated.
s
I often have to right-click in the sidebar and and do "Refresh Gradle dependencies"
a
where do I see this option?
s
In the Gradle sidebar, right-click on your project / build task or whatever it's called... I could screenshot for you when I'm at the computer
a
that would be great, thanks!
i don't see this option anywhere 😞
oh wait a sec
I was looking at the wrong sidebar (Project, not Gradle)
thanks:
found it
👍
s
Yes, that one! 🙂 The Gradle IntelliJ integration seems less than optimal though, in my experience. I often have to do that thing and/or "Reimport Gradld project" a couple of times before changes take effect... 🙁
a
yep
it would be great if this was automatic
a
This should work automatically after project import. After changing the build file, do you get a popup "Gradle projects need to be imported"?
a
i enabled auto-import, but it is not always working