简体   繁体   中英

Setup Maven Repository on private server to share the android library for Android Studio

I have a Gitlab server for Version Control System. I have developed an android library and want to share the android library in a gradle way ie compile "com.mycompanyname.libraryname:version .

I need a guidance on how to set up the repository on my server and how to share the library for gradle building.

I am trying to achieve a gradle mechanism using below given setup:

buildscript {
  repositories {
    jcenter()
    maven { url 'https://any_url_/public' }
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:1.0.+'
    classpath 'io.anything:gradle:1.+'
  }
}

apply plugin: 'com.android.application'

repositories {
    jcenter()
    maven { url 'https://any_url/public' }
}

Local artifact repository would be probably JFrog Artifactory, Apache Archiva or Sonatype Nexus. Here's a co-edited comparison matrix . All three have OSS versions which should do the job for Gradle builds.

Both JFrog and Sonatype have free instances of Artifactory and Nexus correspondingly for OSS projects, so you don't even need to maintain your own server if you don't want to.

Regarding publishing to a local Maven repository and releasing to JFrog Bintray (jcenter) and to Maven Central, there are a lot of good guides ( here's one, for example ).

If you will end up using Artifactory, then you can publish to Bintray JCenter and Maven Central directly from it (that's what Spring Framework, Groovy, Grails and many others are doing), here's the REST API that you'll call (or you can use the UI ).


I am with JFrog , the company behind Bintray and [artifactory] , see my profile for details and links.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM