Gradle + Spring Boot classpath issues


In my project I have two Spring Boot modules: spring-boot-starter and spring-boot-example

I have a run configuration for both these projects:

In order to see what the root/main (don't know the exact term) classpath is, I placed a different banner.txt in both projects:

In the Gradle view, only spring-api-starter is designated as "root":

Now when running the spring-boot-example project, the main/root classpath is pointing to the spring-boot-starter project:

At one time, the Gradle view showed both spring-boot-starter and spring-boot-example as "root" and then it worked as expected. 
I looked into the project settings/structure but I couldn't figure out how I can set the "root" project in Gradle. 

How can I set the correct classpath for both run configurations?
And if this is connected to the Gradle "root" designation, how can I set both projects as "root"?


When I open the same project in IDEA 16 EAP then none of the projects is "root" in the Gradle view:

Now when I run either of the projects, the default Spring Boot banner is shown:

This is very confusing to me )-:


My run configurations:



the classpath to use for running the actual Spring Boot application can be set in the run configuration dialog via combobox "Use classpath of module".


In the Gradle view "root" means the root project of gradle multiproject.

If you just switched to IntelliJ 16, you have to refresh the project from gradle (using "Refresh" button on gradle tool window). Then you need to set right classpath of the Spring Boot application via combobox "Use classpath of module".


I did have the correct modules selected in the run configurations "Use claspath of module" but it didn't work correctly.

I finally got it working (in EAP 16) by removing the .idea folder, reimporting the Gradle project and recreating the run configurations. The Gradle view now also shows the correct root project which it didn't before.

So I am happy now. Thanks.