# Gradle fails to resolve dependencies when using archivesBaseName

**URL:** <https://discuss.gradle.org/t/gradle-fails-to-resolve-dependencies-when-using-archivesbasename/4496>\
**Category:** Old Forum Archive\
**Created:** [July 10, 2012, 9:34pm UTC](https://discuss.gradle.org/t/gradle-fails-to-resolve-dependencies-when-using-archivesbasename/4496 "2012-07-10T21:34:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tinkerer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tinkerer/32/683_2.png) [@Tinkerer](https://discuss.gradle.org/u/Tinkerer)\
**Post date:** [July 10, 2012, 9:34pm UTC](https://discuss.gradle.org/t/gradle-fails-to-resolve-dependencies-when-using-archivesbasename/4496/1 "2012-07-10T21:34:00Z")

</div>

A snippet of my original build.gradle file for ‘ProjectA’ (foldername: ProjectA) has -

```gradle
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 -

[http://artifactory.xyzcorp.com:8080/artifactory/xyz/myGroup/ProjectA/SNAPSHOT/ProjectA-abc-SNAPSHOT.jar](http://artifactory.xyzcorp.com:8080/artifactory/xyz/myGroup/ProjectA/SNAPSHOT/ProjectA-abc-SNAPSHOT.jar)

In a separate project, that consumes ProjectA’s jar, my build.gradle has -

```gradle
..
 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](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 -

```gradle
..
 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](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](http://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?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [July 10, 2012, 9:55pm UTC](https://discuss.gradle.org/t/gradle-fails-to-resolve-dependencies-when-using-archivesbasename/4496/2 "2012-07-10T21:55:00Z")

</div>

This is GRADLE-443, which will be fixed in 1.1. Meanwhile you have two options:

- Set project name (in settings.gradle) to the artifact ID you wish to publish under, rather than setting archivesBaseName. Note that this doesn’t necessarily mean that you’ll have to change the project directory’s name, since that name can be customized too (again in settings.gradle). \* Customize the POM of the depending project to use the correct artifact ID (see user guide on how to customize POM content)

---

<div class="post-metadata">

**Author:** ![Tinkerer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tinkerer/32/683_2.png) [@Tinkerer](https://discuss.gradle.org/u/Tinkerer)\
**Post date:** [July 18, 2012, 6:01pm UTC](https://discuss.gradle.org/t/gradle-fails-to-resolve-dependencies-when-using-archivesbasename/4496/3 "2012-07-18T18:01:00Z")

</div>

Thanks, that works! In my multi-project build I added this to my root settings.gradle -

```gradle
include 'ProjectA'
..
//added the following -
project(':ProjectA').name = 'ProjectA-abc'

```
