I have a android library project A that is used by another library project B as a dependency. When I am deploying the .aar artifact of A to a s3 repo using the below script, its working fine i.e. I am able to resolve dependency in B.
uploadArchives {
repositories {
mavenDeployer { deployer ->
configuration = configurations.deployerAars
def repositoryUrl = 's3://my-mvn-repo/snapshots'
repository(url: repositoryUrl) { authentication(userName: 's3AccessKey',
passphrase: 's3SecureKey')
}
pom.project {
name 'ArtooAPI-Android'
packaging 'aar'
}
}
}
}
However If I deploy the A artifacts to a local maven repo by specifying the local maven repo in the above code and then push the artifacts manually from the local maven repo to my s3 bucket, I am getting a 403: forbidden status from the server while resolving dependencies in A. Here is the exact error -
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'B'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not resolve com.example:A:1.2-SNAPSHOT.
Required by:
com.example.data:B:1.0-SNAPSHOT
> Unable to load Maven meta-data from http://my-mvn-repo.s3.amazonaws.com/snapshots/com/example/A/1.2-SNAPSHOT/maven-metadata.xml.
> Could not GET 'http://my-mvn-repo.s3.amazonaws.com/snapshots/com/example/A/1.2-SNAPSHOT/maven-metadata.xml'. Received status code 403 from server: Forbidden
Is there something I can do to make it work!