for sharing our libraries inside our android team, I tried to setup JFrog Artifactory OSS. Every thing was OK except my team mates can not access the repositories thru our local network.
To deploy repository I add this line to my library's gradle
in my library build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.1"
}
in my module build.gradle
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
def libraryGroupId = 'com.mycomp.mylib'
def libraryArtifactId = 'mylib'
def libraryVersion = '1.0.0'
...
publishing {
publications {
aar(MavenPublication) {
groupId libraryGroupId
version libraryVersion
artifactId libraryArtifactId
artifact("$buildDir/outputs/aar/${artifactId}-release.aar")
}
}
}
artifactory {
contextUrl = 'http://10.220.2.2:8081/artifactory'
publish {
repository {
repoKey = 'libs-release-local'
username = artifactory_username
password = artifactory_password
}
defaults {
publications('aar')
publishArtifacts = true
properties = ['qa.level': 'basic', 'q.os': 'android', 'dev.team': 'core']
publishPom = true
}
}
and Executing tasks 'assembleRelease artifactoryPublish'... is successful:
Deploying artifact: http://10.220.2.2:8081/artifactory/libs-release-local/com/mycomp/mylib/mylib/1.0.0/mylib-1.0.0.aar
Deploying artifact: http://10.220.2.2:8081/artifactory/libs-release-local/com/mycomp/mylib/mylib/1.0.0/mylib-1.0.0.pom
But when we try to get the library it will fail
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.mycomp.mylib:mylib:1.0.0.
Show Details
Affected Modules: app
in my project build.gradle
allprojects {
repositories {
google()
jcenter()
maven {
url "http://10.220.2.2:8081/artifactory/libs-release-local"
credentials {
username = "${artifactory_username}"
password = "${artifactory_password}"
}
}
}
}
in my module build.gradle
implementation "com.mycomp.mylib:mylib:1.0.0"
if I change the IP to localhost it will work for my self just fine, but the problem still exist!
UPDATE:
Repository on the Artifactory web UI screenshots:
libs-release-local
library