4

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 i.e. 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' }
}
rishm.msc
  • 361
  • 5
  • 16

1 Answers1

2

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.

Community
  • 1
  • 1
JBaruch
  • 22,610
  • 5
  • 62
  • 90
  • Thanks @JBaruch for the reply. But mine project is not an open source project so I wont be sharing the source code, bug tracking URL. Hence I would be requiring to setup any repository in my own server for hosting the library and will publish the same from my server.Can you suggest me what I should do for this case? – rishm.msc Sep 10 '15 at 06:43
  • First paragraph :) Just install one of the binary repository managers. – JBaruch Sep 11 '15 at 05:38