gradle 3.4 与idea 的一个问题

https://github.com/gradle/gradle/issues/1276

the problem only happens with the “Create Module per SourceSet” option. This does not use Gradle’s mapping directly, but has some intermediate code contributed by IDEA. It seems this code removes dependencies that are in multiple scopes

with the “Create Module per SourceSet” option IDEA tries to resolve dependency scopes based on gradle sourceSet configuration. And the main scopes here are compile and runtime.
provided scope has been considered as something configured explicitly:

  1. using War Plugin conventions (i.e. providedCompile and providedRuntime configurations)
  2. using workaround provided by IdeaPlugin, I mean ideaPlugin.model.module.scopes[‘PROVIDED’].[‘plus’] option.

In order to honor the second configuration, I had to increase the priority of explicitly configured provided dependencies.

Cause is
JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME configuration as provided by default.