Fix Gradle build failure when there is a direct dependency without
corresponding managed dependency