Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- publishing {
- publications {
- maven(MavenPublication) {
- groupId 'com.umer' //You can either define these here or get them from project conf elsewhere
- artifactId 'myLibrary'
- version project.version
- artifact "$buildDir/outputs/aar/myLibrary-release.aar" //aar artifact you want to publish
- //generate pom nodes for dependencies
- pom.withXml {
- def dependenciesNode = asNode().appendNode('dependencies')
- configurations.compile.allDependencies.each { dependency ->
- def dependencyNode = dependenciesNode.appendNode('dependency')
- dependencyNode.appendNode('groupId', dependency.group)
- dependencyNode.appendNode('artifactId', dependency.name)
- dependencyNode.appendNode('version', dependency.version)
- }
- }
- }
- }
- //publish to filesystem repo
- repositories{
- maven {
- url "C:\Users\Umer\AndroidStudioProjects\android\myLibrary\artifacts"
- }
- }
- }
- dependencies {
- provided ('com.umer.myLibrary:myLibrary-1.1')
- }
- buildscript {
- repositories {
- google()
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0'
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
- }
- allprojects {
- repositories {
- google()
- jcenter()
- flatDir {
- dirs 'libs'
- }
- maven {
- url 'http:/GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts'
- credentials {
- username = "myUserName"
- password = "myPassword"
- }
- }
- }
- }
- task clean(type: Delete) {
- delete rootProject.buildDir
- }
- systemProp.http.proxyHost=127.0.0.1
- systemProp.https.proxyPort=12345
- org.gradle.jvmargs=-Xmx1536m
- systemProp.https.proxyHost=127.0.0.1
- systemProp.http.proxyPort=12345
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.umer.myLibrary:myLibrary-1.1:.
- Could not resolve com.umer.myLibrary:myLibrary-1.1:.
- Required by:
- project :app
- > Could not resolve com.umer.myLibrary:myLibrary-1.1:.
- > Could not get resource 'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'.
- > Could not HEAD 'http://GIT_LAB_IP_ADDRESS/dev/myLibrary/tree/remoteRepoPublication/artifacts/com/umer/myLibrary/myLibrary-1.1//myLibrary-1.1-.pom'.
- > Connect to 127.0.0.1:12345 [/127.0.0.1] failed: Connection refused: connect
- > Connection refused: connect
Add Comment
Please, Sign In to add comment