When the Gradle Tooling API is invoked directly via a subproject it doesn't obey the gradle wrapper version from the parent project.
I discovered this while experimenting with http://static.springsource.org/spring-security/site/source.html
This project seems to the same bug as spring-integration: http://issues.gradle.org/browse/GRADLE-1701
However, its gradle wrapper specifies to use M3 (which means that it should not hit the bug).
It indeed does not hit the bug when the model gets built from the root project. However, when requesting a model build from one of the subprojects (such as will happen in STS if you perform a "refresh dependencies" operation on a specific subproject) then it seems to fall back to using the tooling api's default version rather than the wrapper default. In this case it will hit the bug (and the error message indicates M4 was being used).
In my mind this is a rather serious bug because it causes very unpredictable behavior for multi-project builds in the IDE, where it somewhat randomly varies which gradle version you end up using depending on things such as project build order etc.