Issue
How do you add dependencies into build.gradle then work with those dependencies straight away in the IDE? (I've tried it with STS & Netbeans)
Here is the long story: I was following springs consuming rest tutorial (modifying it slightly to suit my own rest service and objects). I started a new gradle project, then added the dependencies to build.gradle. Then when I added RestTemplate into the main application file, I could not resolve it. I tried building the project and while I noted it downloaded the dependencies I still could not resolve RestTemplate (nor @JsonIgnoreProperties(ignoreUnknown=true)). In Spring Tool Suite I tried restarting the application and nothing changed. In Netbeans I tried restarting the application and it worked! But I'd rather have more control over this than trial'n'error. What's the proper procedure?
Edit Peter has answered STS in the comments. Netbeans anyone?
Solution
I'm the developer of the NetBeans integration of Gradle. In NetBeans, if you edit your build script, you have to reload the project for NetBeans to detect the changes. You can reload the project by selecting "Reload project" in the context menu of the project. In practice, you should only reload, if you have adjusted the compile time dependencies.
Since plugin version 1.2.7, if you are using Gradle 1.9 or above (Gradle 1.8 does not work properly with NetBeans: debugging features will be broken), more exotic non-standard configurations are detected automatically as well (adding a new source set with different set of dependencies, provided dependencies, ect.).
I have set up a Wiki page which you might want to read if you would like to know more.
Answered By - Attila Kelemen
Answer Checked By - Gilberto Lyons (JavaFixing Admin)