This message was deleted.
# community-support
s
This message was deleted.
v
The description looks like a bug to me.
Can you share the code where you use
withDependencies
?
c
It’s in a custom plugin that does a fairly complex piece of shading for me… I eventually got it working with this tangle:
Copy code
Configuration contentsSourcesElements = jvmPluginServices.createResolvableConfiguration(CONTENTS_SOURCES_ELEMENTS_CONFIGURATION_NAME, builder ->
        builder.requiresAttributes(refiner -> refiner.documentation(SOURCES))).withDependencies(config -> {
  contentsRuntimeElements.getResolvedConfiguration().getResolvedArtifacts().forEach(resolvedArtifact -> {
    ComponentIdentifier id = resolvedArtifact.getId().getComponentIdentifier();
    if (id instanceof ProjectComponentIdentifier) {
      ProjectComponentIdentifier projectId = (ProjectComponentIdentifier) id;
      config.add(project.getDependencies().create(project.project(projectId.getProjectPath())));
    } else if (id instanceof ModuleComponentIdentifier) {
      ModuleComponentIdentifier moduleId = (ModuleComponentIdentifier) id;
      config.add(project.getDependencies().create(Utils.mapOf(
              "group", moduleId.getGroup(),
              "name", moduleId.getModule(),
              "version", moduleId.getVersion())));
    } else {
      throw new GradleException("Unsupported component identifier type: " + id);
    }
  });
}).resolutionStrategy(resolutionStrategy -> ((ResolutionStrategyInternal) resolutionStrategy).assumeFluidDependencies());
my understanding is that by default the graph is not resolved before build dependencies are evaluated