A noob question: I just added new dependency in `b...
# gradle
j
A noob question: I just added new dependency in
build.gradle.kts
after the prior build, like
Copy code
dependencies {
    // ...
    implementation("org.springframework.boot:spring-boot-starter-security")
    implementation("org.springframework.security:spring-security-test")
}
, but when I build in IntelliJ, the new dependencies doesn’t get installed: I can’t see them in the External Libraries, and I can’t import them. Am I missing something here? Or is there a certain other way to update the dependencies?
Solved it. I found Gradle Tool Window and pressed the ‘Reimport All Gradle Projects’ button. But why is this a separated thing with the ‘Build’? For me it seemed intuitive that the changes in the build script would be applied if I rebuild the project, thus importing the changed dependencies.
s
There is a popup option that IntelliJ can auto-import for you. This way, when you update a gradle file, it will do the reimport for you.
j
Couple of following questions: 1. Is there a way to update the dependencies via command line? 2. Is there a way to change the behavior, that the changed dependencies automatically get imported?
@Sebastien Leclerc Lavallee That’s strange. I recall that I saw this popup option a couple of days ago and I toggled it on. Or is this option always per Project?
s
🤔 I think it’s per project yes. You can probably toggle it on in the options somewhere
j
Oh, I think I found it: Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle then there’s the ‘Automatically import this project on changes in build script file’. Thanks
s
That seems to be it indeed, no problem 🙂