3

I want to publish my aar but do not want to publish it with open source license. Hence, what is the right way to do it. I tried the jCenter() but it is paid and Amazon S3 only allows private repo hosting. I want it public.

Thanks in advance.

Kanika
  • 714
  • 8
  • 24
  • 1
    "Amazon S3 only allows private repo hosting" -- no, it doesn't. My CWAC libraries are in an S3-hosted public artifact repository (`https://s3.amazonaws.com/repo.commonsware.com`). – CommonsWare Oct 04 '17 at 17:04
  • Thats great..Can you tell me steps on how to do it and how will it distributed. – Kanika Oct 04 '17 at 17:06
  • It's just a directory structure. I use the `maven` plugin and its `uploadArchives` task to push the artifacts into a local repository on my development machine's hard drive. I then wrote a Ruby script to generate `index.html` files for each directory (which at least used to be required, not sure if it still is) and sync the tree with Amazon S3. Most likely, there are better recipes for this. – CommonsWare Oct 04 '17 at 17:14
  • That was not helpful as wherever I looked for examples, they said that whoever wants access to your aar file on S3 would have to have aws credentials. My question is how can an android developer access my aar file hosted on S3. Detailed steps would be helpful as I posted this question after doing a lot of research. – Kanika Oct 04 '17 at 17:18
  • "they said that whoever wants access to your aar file on S3 would have to have aws credentials" -- set the ACLs as public/read-only on the files. You don't have to use S3; any HTTP server will do. In fact, there would be advantages to hosting somewhere else, due to the limitations on using SSL with S3 (i.e., being stuck with `https://s3.amazonaws.com/repo.commonsware.com` instead of `https://repo.commonsware.com`). – CommonsWare Oct 04 '17 at 17:23
  • See also [this](https://stackoverflow.com/questions/7526814/is-there-any-free-online-maven-repository). – CommonsWare Oct 04 '17 at 17:29
  • Thanks, I will give it a try and will ask you again in case of further questions. – Kanika Oct 04 '17 at 17:29

1 Answers1

4

After a lot of research, I found the solution.

  1. If you want to distribute your artifact and do not want to make it open source and can spend money, then jCenter() is the best way to go.

  2. If you want to distribute your artifact for free and can make it Open source, then distributing it with Apache license is the best way to go.

  3. If you still want to distribute your artifact for free and do not want to make it Open Source, you can host the maven repo in the GitHub. Following article helped me in doing that: http://andydyer.org/blog/2014/10/05/hosting-android-dependencies-on-github/

Oleg Sokolov
  • 1,134
  • 1
  • 12
  • 19
Kanika
  • 714
  • 8
  • 24