I’m working on a plugin that configures several other gradle plugins. Right now I’m using my plugin to install the gradle application plugin, for some reason I think this is breaking dependency resolution for my project.
I have something that looks close to this:
public class ApplicationCustomization implements Plugin<Project> {
@Override
public void apply(Project project) {
project.getPlugins().apply(ApplicationPlugin.class);
ServiceConfiguration serviceConfiguration = PluginUtils.getServiceConfiguration(project);
registerMainClass(project, serviceConfiguration);
applicationPluginConfiguration(project);
}
}
I’m trying to use gradle testKit to verify that I can add dependencies, this is what the test build.gradle looks like:
Does getServiceConfiguration, registerMainClass, or applicationPluginConfiguration do anything with dependency configurations? Specifically, do they resolve any of the configurations in the project?
I’m assuming the answer is yes. Do you have any suggestions on how I can defer this behavior so that I don’t bump into the problem I’m seeing? Would this be a candidate for a do last type of task or something? I thought dependencies needed to be part of the configuration phase though?
Ok, I think I figured out where this error is coming from. I’m staging dependencies in the build directory for sonar to scan. I’m clearly going about this the wrong way. Any suggestions?
I’m curious why you want to exclude files in the runtime classpath from the test runtime classpath. What if the test runtime has some of the same dependencies as runtime (which in most cases is true since the test configurations extend from the main configurations)?
The license reporting tool wired into CI at my work expects them to be separated in this way. I’m not sure what the rationale is, but the tool is polyglot so maybe it has something to do with it originally being built for another language or something.