public ConfigurationInternal detachedConfiguration(Dependency... dependencies) {
String name = DETACHED_CONFIGURATION_DEFAULT_NAME + detachedConfigurationDefaultNameCounter++;
DetachedConfigurationsProvider detachedConfigurationsProvider = new DetachedConfigurationsProvider();
DefaultConfiguration detachedConfiguration = new DefaultConfiguration(
name, name, detachedConfigurationsProvider, resolver,
listenerManager, dependencyMetaDataProvider, new DefaultResolutionStrategy());
DomainObjectSet<Dependency> detachedDependencies = detachedConfiguration.getDependencies();
for (Dependency dependency : dependencies) {
detachedDependencies.add(dependency.copy());
}
detachedConfigurationsProvider.setTheOnlyConfiguration(detachedConfiguration);