Adding dependancies in Project Structure does not update build.gradle
I have created a Java gradle project in IntelliJ IDEA 2018.1 (Community Edition) that has 2 modules: main and ExampleModule. However, trying to update dependancies for main under Project Structure>Modules>Main>Dependancies produces this message: "Module projectname_main is imported from Gradle. Any changes made to its configuration may be lost after reimporting." and after clicking apply and done, build.gradle is not updated therefore the dependancy is not present when I build the project. I have to manually write 'compile project...' in build.gradle for it to work.
I have used Android studio where I update dependancies under the project structure window and therefore haven't learned to write the groovy script commands in build.gradle myself
Please sign in to leave a comment.
This behavior is by design, IntelliJ IDEA Maven and Gradle integrations are one way only.
So what would solce above issue then? I have same issue.
@Matt Ada for Maven/Gradle based project you should configure dependencies in pom.xml/build.gradle files. See https://www.jetbrains.com/help/idea/gradle.html