Download all dependencies rather than the latest version only in gradle

I am trying to fetch all the version of single dependency from the artifactory through my gradle script.The issue is gradle only fetch the latest version of the dependency and that is causing an issue with my applcation.whereas I am able to do the same in maven.Why gradle is not fetching all the version of that dependency.Below is the example

dependencies {
    runtime "carediscovery.services:GenericServices:1.0@jar"
    runtime "carediscovery.services:GenericServices:1.1@jar"
    runtime "carediscovery.services:GenericServices:1.2@jar"
    runtime "carediscovery.services:GenericServices:1.3@jar"
    runtime "carediscovery.services:GenericServices:1.5@jar"
    runtime "carediscovery.services:GenericServices:1.6@jar"
}

Gradle script is fetching only 1.6 version for GenericServices.

Can someone tell me is there anyway to fetch all the dependencies from 1.0…1.6 in gradle?

In maven to copying specific artifacts, you need to bind the dependency:copy mojo to a lifecycle, configure the plugin and specify the artifacts you want to copy

In maven they are doing this

 <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>carediscovery.services</groupId>
                                    <artifactId>AdhocReportAddService</artifactId>
                                    <version>1.0</version>
                                    <outputDirectory>${basedir}/services/carediscovery/services/</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>carediscovery.services</groupId>
                                    <artifactId>AdhocReportAddService</artifactId>
                                    <version>1.1</version>
                                    <outputDirectory>${basedir}/services/carediscovery/services/</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>carediscovery.services</groupId>
                                    <artifactId>AdhocReportAddService</artifactId>
                                    <version>1.2</version>
                                    <outputDirectory>${basedir}/services/carediscovery/services/</outputDirectory>
                                </artifactItem>
        </artifactItem>
                            </artifactItems>
                      </configuration>
                  </execution>
              </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.3</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>

This doesn’t work because Gradle will use conflict resolution to pick one of the versions. If you want to download multiple versions of the same module you’ll have to assign them to different configurations.

(0..6).each { version ->
    configurations.create("deps$version")
    dependencies.add("deps$version", "carediscover.services:GenericServices:1.$version@jar")
}

task copy(type: Copy) {
    from((0..6).collect { configurations."deps$it" })
    into 'services/carediscovery/services'
}

Yeah this will work if we need to fetch multiple version for single module but I am not sure how this logic will work in below scenerio where we don’t have sequence like 0…87.Some version doesn’t exist in 0…87 and we have multiple module .

dependencies {
    runtime "carediscovery.services:AdhocReportAddService:1.0@jar"	 
    runtime "carediscovery.services:AdhocReportAddService:1.1@jar"
    runtime "carediscovery.services:AdhocReportAddService:1.2@jar"
    runtime "carediscovery.services:AdhocReportUpdateService:1.0@jar"
    runtime "carediscovery.services:AdhocReportUpdateService:1.1@jar"
    runtime "carediscovery.services:AnalysisOptionSaveService:1.0@jar"
    runtime "carediscovery.services:AnalysisOptionSaveService:1.1@jar"
    runtime "carediscovery.services:AvailableValues:1.0@jar"
    runtime "carediscovery.services:STCDataValidationGenericServices:1.1@jar"
    runtime "carediscovery.services:STCDataValidationGenericServices:1.2@jar"
    runtime "carediscovery.services:GenericServices:1.0@jar"
    runtime "carediscovery.services:GenericServices:1.1@jar"
    runtime "carediscovery.services:GenericServices:1.2@jar"
    runtime "carediscovery.services:GenericServices:1.3@jar"
    runtime "carediscovery.services:GenericServices:1.5@jar"
    runtime "carediscovery.services:GenericServices:1.6@jar"
    runtime "carediscovery.services:GenericServices:1.8@jar"
    runtime "carediscovery.services:GenericServices:1.9@jar"
    runtime "carediscovery.services:GenericServices:1.10@jar"
    runtime "carediscovery.services:GenericServices:1.11@jar"
    runtime "carediscovery.services:GenericServices:1.12@jar"
    runtime "carediscovery.services:GenericServices:1.13@jar"
    runtime "carediscovery.services:GenericServices:1.14@jar"
    runtime "carediscovery.services:GenericServices:1.16@jar"
    runtime "carediscovery.services:GenericServices:1.17@jar"
    runtime "carediscovery.services:GenericServices:1.18@jar"
    runtime "carediscovery.services:GenericServices:1.19@jar"
    runtime "carediscovery.services:GenericServices:1.20@jar"
    runtime "carediscovery.services:GenericServices:1.21@jar"
    runtime "carediscovery.services:GenericServices:1.22@jar"
    runtime "carediscovery.services:GenericServices:1.23@jar"
    runtime "carediscovery.services:GenericServices:1.24@jar"
    runtime "carediscovery.services:GenericServices:1.25@jar"
    runtime "carediscovery.services:GenericServices:1.26@jar"
    runtime "carediscovery.services:GenericServices:1.27@jar"
    runtime "carediscovery.services:GenericServices:1.28@jar"
    runtime "carediscovery.services:GenericServices:1.29@jar"
    runtime "carediscovery.services:GenericServices:1.30@jar"
    runtime "carediscovery.services:GenericServices:1.31@jar"
    runtime "carediscovery.services:GenericServices:1.32@jar"
    runtime "carediscovery.services:GenericServices:1.33@jar"
    runtime "carediscovery.services:GenericServices:1.34@jar"
    runtime "carediscovery.services:GenericServices:1.35@jar"
    runtime "carediscovery.services:GenericServices:1.36@jar"
    runtime "carediscovery.services:GenericServices:1.37@jar"
    runtime "carediscovery.services:GenericServices:1.38@jar"
    runtime "carediscovery.services:GenericServices:1.39@jar"
    runtime "carediscovery.services:GenericServices:1.40@jar"
    runtime "carediscovery.services:GenericServices:1.41@jar"
    runtime "carediscovery.services:GenericServices:1.42@jar"
    runtime "carediscovery.services:GenericServices:1.43@jar"
    runtime "carediscovery.services:GenericServices:1.44@jar"
    runtime "carediscovery.services:GenericServices:1.45@jar"
    runtime "carediscovery.services:GenericServices:1.46@jar"
    runtime "carediscovery.services:GenericServices:1.47@jar"
    runtime "carediscovery.services:GenericServices:1.48@jar"
    runtime "carediscovery.services:GenericServices:1.49@jar"
    runtime "carediscovery.services:GenericServices:1.50@jar"
    runtime "carediscovery.services:GenericServices:1.51@jar"
    runtime "carediscovery.services:GenericServices:1.52@jar"
    runtime "carediscovery.services:GenericServices:1.53@jar"
    runtime "carediscovery.services:GenericServices:1.55@jar"
    runtime "carediscovery.services:GenericServices:1.56@jar"
    runtime "carediscovery.services:GenericServices:1.57@jar"
    runtime "carediscovery.services:GenericServices:1.59@jar"
    runtime "carediscovery.services:GenericServices:1.60@jar"
    runtime "carediscovery.services:GenericServices:1.61@jar"
    runtime "carediscovery.services:GenericServices:1.62@jar"
    runtime "carediscovery.services:GenericServices:1.63@jar"
    runtime "carediscovery.services:GenericServices:1.64@jar"
    runtime "carediscovery.services:GenericServices:1.65@jar"
    runtime "carediscovery.services:GenericServices:1.66@jar"
    runtime "carediscovery.services:GenericServices:1.67@jar"
    runtime "carediscovery.services:GenericServices:1.68@jar"
    runtime "carediscovery.services:GenericServices:1.69@jar"
    runtime "carediscovery.services:GenericServices:1.70@jar"
    runtime "carediscovery.services:GenericServices:1.71@jar"
    runtime "carediscovery.services:GenericServices:1.72@jar"
    runtime "carediscovery.services:GenericServices:1.73@jar"
    runtime "carediscovery.services:GenericServices:1.74@jar"
    runtime "carediscovery.services:GenericServices:1.75@jar"
    runtime "carediscovery.services:GenericServices:1.76@jar"
    runtime "carediscovery.services:GenericServices:1.78@jar"
    runtime "carediscovery.services:GenericServices:1.79@jar"
    runtime "carediscovery.services:GenericServices:1.80@jar"
    runtime "carediscovery.services:GenericServices:1.81@jar"
    runtime "carediscovery.services:GenericServices:1.82@jar"
    runtime "carediscovery.services:GenericServices:1.83@jar"
    runtime "carediscovery.services:GenericServices:1.84@jar"
    runtime "carediscovery.services:GenericServices:1.85@jar"
    runtime "carediscovery.services:GenericServices:1.86@jar"
    runtime "carediscovery.services:GenericServices:1.87@jar"
    runtime "carediscovery.services:SharedPatientPopulationReadService:1.2@jar"
    runtime "carediscovery.services:SharedPatientPopulationReadService:1.3@jar"
    runtime "carediscovery.services:SharedPatientPopulationReadService:1.4@jar"
    runtime "carediscovery.services:LoadPathways:1.0@jar"
    runtime "carediscovery.services:LoadPathways:1.1@jar"
    runtime "carediscovery.services:PatientPopulationReadService:1.0@jar"
    runtime "carediscovery.services:PatientPopulationReadService:1.1@jar"
    runtime "carediscovery.services:PatientPopulationReadService:1.2@jar"
    runtime "carediscovery.services:PatientPopulationSaveService:1.0@jar"
    runtime "carediscovery.services:PatientPopulationSaveService:1.1@jar"
    runtime "carediscovery.services:SharedAdhocReportSaveService:1.0@jar"
    runtime "carediscovery.services:SharedAdhocReportSaveService:1.1@jar"
    runtime "carediscovery.services:RetrievePhysicianService:1.0@jar"
    runtime "carediscovery.services:RetrievePhysicianService:1.1@jar"
    runtime "carediscovery.services:RetrievePhysicianService:1.2@jar"
    runtime "carediscovery.services:PhysicianTargeterSaveService:1.1@jar"
    runtime "carediscovery.services:PhysicianTargeterSaveService:1.2@jar"
    runtime "carediscovery.services:PhysicianTargeterReadService:1.2@jar"
    runtime "carediscovery.services:SharedPhysicianTargeterReadService:1.1@jar"
    runtime "carediscovery.services:SharedPhysicianTargeterReadService:1.2@jar"
    runtime "carediscovery.services:SharedPhysicianTargeterReadService:1.3@jar"
    runtime "carediscovery.services:SharedPhysicianTargeterReadService:1.4@jar"
    runtime "carediscovery.services:SharedTargeterSaveService:1.0@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.0@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.1@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.2@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.3@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.4@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.5@jar"
    runtime "carediscovery.services:OpportunitySaveService:1.6@jar"
    runtime "carediscovery.services:OpportunityReadService:1.1@jar"
    runtime "carediscovery.services:OpportunityReadService:1.2@jar"
    runtime "carediscovery.services:OpportunityPublishService:1.3@jar"
    runtime "carediscovery.services:LinkOpptyPublishService:1.1@jar"
    runtime "carediscovery.services:OpportunityDrillDownService:1.4@jar"
    runtime "carediscovery.services:OpportunityDrillUpService:1.3@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.0@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.1@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.2@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.3@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.4@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.5@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.6@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.7@jar"
    runtime "carediscovery.services:RetrieveVarianceDataService:1.8@jar"
    runtime "carediscovery.services:WizardService:1.0@jar"
    runtime "carediscovery.services:WizardService:1.1@jar"
    runtime "carediscovery.services:NullifyTargetSessionService:1.0@jar"
    runtime "carediscovery.services:NullifyTargetSessionService:1.1@jar"
    runtime "carediscovery.services:NullifyTargetSessionService:1.2@jar"
    runtime "carediscovery.services:NullifyTargetSessionService:1.3@jar"
    runtime "carediscovery.services:NullifyTargetSessionService:1.4@jar"
    runtime "carediscovery.services:NullifyTargetSessionService:1.5@jar"
    runtime "carediscovery.services:UpdatePhysicianExclusionFlagService:1.0@jar"
    runtime "carediscovery.services:UpdatePhysicianExclusionFlagService:1.1@jar"
    runtime "carediscovery/services:OpportunityFilterService:1.0@jar" 
    runtime "carediscovery.services:CareDiscoveryReportData:1.7@jar"
    runtime "carediscovery.services:CareDiscoveryReportData:1.8@jar"
    runtime "carediscovery.services:CareDiscoveryReportData:1.9@jar"
    runtime "carediscovery.services:CareDiscoveryReportData:1.10@jar"
    runtime "carediscovery.services:CareDiscoveryReportData:1.11@jar"
    runtime "carediscovery.services:CareDiscoveryReportData:1.15@jar"
    runtime "carediscovery.services:SharedOpportunitySaveService:1.0@jar"
    runtime "carediscovery.services:SharedOpportunitySaveService:1.1@jar"
    runtime "carediscovery.services:SharedOpportunitySaveService:1.2@jar"
    runtime "carediscovery.services:SharedLinkOpptySaveService:1.0@jar"
    runtime "carediscovery.services:SharedLinkOpptyImportService:1.0@jar"
    runtime "carediscovery.services:SharedOpportunityReadService:1.0@jar"
    runtime "carediscovery.services:SharedOpportunityReadService:1.1@jar"
    runtime "carediscovery.services:DraftOpportunitySaveService:1.3@jar"
    runtime "carediscovery.services:DraftLinkOpptySaveService:1.0@jar"
    runtime "carediscovery.services:DraftOpportunityUpdateService:1.1@jar"
    runtime "carediscovery.services:PublishOpportunityReadService:1.1@jar"
    runtime "carediscovery.services:PublishedOpportunityReadService:1.1@jar"
    runtime "carediscovery.services:AnalysisListService:2.0@jar"
     }

In this case you’ll simply need a slightly more complex data structure, perhaps a Map instead of a simple List.

def deps = [GenericServices: (0..87), LoadPathways: (0..1)]

deps.each { dep, version ->
    configurations.create("$dep$version")
    dependencies.add("deps$version", "carediscover.services:$dep:1.$version@jar")
}

task copy(type: Copy) {
    from(deps.collect { dep -> dep.value.collect { configurations."$dep.key$it" } }.flatten())
    into 'services/carediscovery/services'
}

I tried this code but this is throwing an error.I changed the BOLD things in the code so it succesfull but now it throwing an error in copy task

apply plugin: 'java'
			 

      repositories {
        maven {
          url "http://cm.tsh.t.com:8/artifactory/services-release-local"
        }
      }
      
      
    def deps = [GenericServices: (0..6), LoadPathways: (0..1)]
    
    deps.each { dep, version ->
        configurations.create("$dep$version")
        dependencies.add("$dep$version", "carediscovery.services:$dep:1.$version@jar")
    }
    
    task copy(type: Copy) {
        from(deps.collect { dep -> dep.value.collect { configurations."$dep.key$it" } }.flatten())
        into 'services/carediscovery/services'
    }

Below is the error

AILURE: Build failed with an exception.

Where:
uild file ‘C:\NEW_HG_WORKSPACE\APPLICATION-DATA\build.gradle’ line: 19

What went wrong:
problem occurred evaluating root project ‘application-data’.
Could not find property ‘GenericServices0’ on configuration container.

Try:
un with --stacktrace option to get the stack trace. Run with --info or --debug
ption to get more log output.

BUILD FAILED

otal time: 5.689 secs

My mistake, we need to loop over the versions.

deps.each { dep, versions -> 
    versions.each { version -> {
        configurations.create("$dep$version")
        dependencies.add("$dep$version", "carediscovery.services:$dep:1.$version@jar")
    }
}

Hi Mark

I corrected the solution.You added this versions.each { version -> { and this “{” was causing an issue after removing this I am able to download the dependency.Once more thing here with this solution we need to stick with this kind of version like 1.0…1.1…if the dev team change the version 2.0 then we can download the 1.0 version and they can go to 3 digit version.

apply plugin: 'java'
			 

      repositories {
    maven {
      url "http://c.t.tn.com:8/artifactory/services-release-local"
    }
  }
      
      
    def deps = [GenericServices: (0..6), LoadPathways: (0..1)]
    
    deps.each { dep, versions -> 
    versions.each { version -> 
        configurations.create("$dep$version")
        dependencies.add("$dep$version", "carediscovery.services:$dep:1.$version@jar")
    }
} 
    
    task copy(type: Copy) {
        from(deps.collect { dep -> dep.value.collect { configurations."$dep.key$it" } }.flatten())
        into 'services/carediscovery/services'
    }

There is another solution now which I am using .We can use the below plugin to download the dependency

plugins {
    id "de.undercouch.download" version "1.2"
}

import de.undercouch.gradle.tasks.download.Download
apply plugin: 'java'
apply plugin: 'de.undercouch.download'

  repositories {
    maven {
     url "http://c.t.tn.com:8/artifactory/services-release-local"
    }
  }

def deps = [
                    [ "carediscovery/services", "AdhocReportAddService", "1.0", "jar" ],
                    [ "carediscovery/services", "AdhocReportAddService", "1.1", "jar" ],
		    [ "carediscovery/services", "AdhocReportAddService", "1.2", "jar" ],
		    [ "carediscovery/services", "AdhocReportUpdateService", "1.0", "jar" ],
		    [ "carediscovery/services", "AdhocReportUpdateService", "1.1", "jar" ],
		    [ "carediscovery/services", "AnalysisOptionSaveService", "1.0", "jar" ],
		    [ "carediscovery/services", "AnalysisOptionSaveService", "1.1", "jar" ],
		    [ "carediscovery/services", "AvailableValues", "1.0", "jar" ],
		    [ "carediscovery/services", "STCDataValidationGenericServices", "1.1", "jar" ],
			[ "carediscovery/services", "STCDataValidationGenericServices", "1.2", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.0", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.1", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.2", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.3", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.5", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.6", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.8", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.9", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.10", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.11", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.12", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.13", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.14", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.16", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.83", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.84", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.85", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.86", "jar" ],
			[ "carediscovery/services", "GenericServices", "1.87", "jar" ],
			[ "carediscovery/services", "SharedPatientPopulationReadService", "1.2", "jar" ],
			[ "carediscovery/services", "SharedPatientPopulationReadService", "1.3", "jar" ],
			[ "carediscovery/services", "SharedPatientPopulationReadService", "1.4", "jar" ],
			[ "carediscovery/services", "LoadPathways", "1.0", "jar" ],
			[ "carediscovery/services", "LoadPathways", "1.1", "jar" ],
			[ "carediscovery/services", "PatientPopulationReadService", "1.0", "jar" ],
			[ "carediscovery/services", "PatientPopulationReadService", "1.1", "jar" ],
		        [ "carediscovery/services", "PatientPopulationReadService", "1.2", "jar" ],
			[ "carediscovery/services", "PatientPopulationSaveService", "1.0", "jar" ],
			[ "carediscovery/services", "RetrieveVarianceDataService", "1.5", "jar" ],
			[ "carediscovery/services", "RetrieveVarianceDataService", "1.6", "jar" ],
			[ "carediscovery/services", "RetrieveVarianceDataService", "1.7", "jar" ],
			[ "carediscovery/services", "RetrieveVarianceDataService", "1.8", "jar" ],
			[ "carediscovery/services", "WizardService", "1.0", "jar" ],
			[ "carediscovery/services", "WizardService", "1.1", "jar" ],
			[ "carediscovery/services", "NullifyTargetSessionService", "1.0", "jar" ],
			[ "carediscovery/services", "NullifyTargetSessionService", "1.1", "jar" ],
			[ "carediscovery/services", "NullifyTargetSessionService", "1.2", "jar" ],
			[ "carediscovery/services", "NullifyTargetSessionService", "1.3", "jar" ],
			[ "carediscovery/services", "NullifyTargetSessionService", "1.4", "jar" ],
			[ "carediscovery/services", "NullifyTargetSessionService", "1.5", "jar" ],
			[ "carediscovery/services", "UpdatePhysicianExclusionFlagService", "1.0", "jar" ],
			[ "carediscovery/services", "UpdatePhysicianExclusionFlagService", "1.1", "jar" ],
			[ "carediscovery/services", "SharedOpportunityReadService", "1.0", "jar" ],
			[ "carediscovery/services", "SharedOpportunityReadService", "1.1", "jar" ],
			[ "carediscovery/services", "DraftOpportunitySaveService", "1.3", "jar" ],
			[ "carediscovery/services", "DraftLinkOpptySaveService", "1.0", "jar" ],
			[ "carediscovery/services", "DraftOpportunityUpdateService", "1.1", "jar" ],
			[ "carediscovery/services", "PublishOpportunityReadService", "1.1", "jar" ],
			[ "carediscovery/services", "PublishedOpportunityReadService", "1.1", "jar" ],
			[ "carediscovery/services", "AnalysisListService", "2.0", "jar" ]
		   ]
		   
task downloadArts << {
     //Iterate over each dependencies as per the list
     deps.each { groupId, artifactId, version, extn ->
          download {
              src "http://c.t.tn.com:8/artifactory/services-release-local/$groupId/$artifactId/$version/$artifactId-$version.$extn"
              dest 'services/carediscovery/services'
            }
     }
}

Can we try something in below way…but I m not sure how to write the copy task for this

def deps = [
                    [ "carediscovery.services", "AdhocReportAddService", "1.0", "jar" ],
                    [ "carediscovery.services", "AdhocReportAddService", "1.1", "jar" ],
		      [ "carediscovery.services", "AnalysisListService", "2.0", "jar" ]
		   ]  
  
   deps.each { groupid, artifactId, version, ext -> 
        configurations.create("$groupid$artifactId$version$ext")
        dependencies.add("$groupid$artifactId$version$ext", "$groupid:$artifactid:$version@$ext")
    }
}
    
    task copy(type: Copy) {
        from(deps.collect { dep -> dep.value.collect { configurations."$dep.key$it" } }.flatten())
        into 'services/carediscovery/services'
    }