Prevent plugins from tampering with project configurations


I have custom configurations that are set up before applying the java plugin. Once the java plugin is configured it is overriding some of my configurations (such as setting “compile” and “testCompile” to private). How can I stop the java plugin from tampering with my configurations?

Note that I have tried setting up the configurations twice - once right away and once in project.afterEvaluate. The afterEvaluate option does not work because it appears that setExtendsFrom puts a configuration in a non-mutable mode. See topic: