ivyContextManager.withIvy(new Action<Ivy>() {
public void execute(Ivy ivy) {
Set<Configuration> allConfigurations = configuration.getAll();
Set<Configuration> configurationsToPublish = configuration.getHierarchy();
MutableLocalComponentMetaData componentMetaData = publishLocalComponentFactory.convert(allConfigurations, module);
if (descriptor != null) {
ModuleDescriptor moduleDescriptor = componentMetaData.getModuleDescriptor();
ivyModuleDescriptorWriter.write(moduleDescriptor, descriptor);
}
// Need to convert a second time, to determine which artifacts to publish (and yes, this isn't a great way to do things...)
componentMetaData = publishLocalComponentFactory.convert(configurationsToPublish, module);
BuildableIvyModulePublishMetaData publishMetaData = componentMetaData.toPublishMetaData();
if (descriptor != null) {
Artifact artifact = MDArtifact.newIvyArtifact(componentMetaData.getModuleDescriptor());
publishMetaData.addArtifact(artifact, descriptor);
}
List<ModuleVersionPublisher> publishResolvers = new ArrayList<ModuleVersionPublisher>();
for (PublicationAwareRepository repository : repositories) {