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>