A snippet of my original build.gradle file for ‘ProjectA’ (foldername: ProjectA) has -
apply plugin: 'java'
group = 'myGroup'
archivesBaseName = 'ProjectA-abc'
version = 'SNAPSHOT'
...
This results in a jar artifact named ProjectA-abc-SNAPSHOT.jar
I am using the gradle-artifactory plugin to publish to an Artifactory repo. The upload url looks like this -
In a separate project, that consumes ProjectA’s jar, my build.gradle has -
..
dependencies {
compile(group: 'myGroup', name: 'ProjectA', version: 'SNAPSHOT', ext: 'jar')
}
When I type gradle build, the build fails to resolve the dependency. Analyzing the Gradle log shows that it’s trying to do a GET request to the resource at http://artifactory.xyzcorp.com:8080/artifactory/xyz/myGroup/ProjectA/SNAPSHOT/ProjectA-SNAPSHOT.jar , which does not exist and fails!
Changing the above dependency to use name: ‘ProjectA-abc’ , instead, leads to another similar failure -
..
dependencies {
compile(group: 'myGroup', name: 'ProjectA-abc', version: 'SNAPSHOT', ext: 'jar')
}
The GET request in this case is to the resource at http://artifactory.xyzcorp.com:8080/artifactory/xyz/myGroup/ProjectA-abc/SNAPSHOT/ProjectA-abc-SNAPSHOT.jar , which does not exist and fails too!
Is there a way I could influence the url that is being constructed (or the artifactId) so that consumers of my artifacts can get to my Project-abc-SNAPSHOT.jar without fail? Something like Project.name = ‘Project-abc’ instead of using archivesBaseName property from the java plugin. What Project properties (project.artifactId?) could I use instead of using archivesBaseName?