can i merge three maven android project into a single one using maven ?
thanks
regards
If the three projects are Android Library projects (<packaging>apklib</packaging>), you should be able to collect them into a single Android Application project (<packaging>apk</packaging>).
Using Maven Android Plugin version 2.9.0-beta-2 or later, you should be able to accomplish that.
Here are the release notes for 2.9.0-beta-1:
http://groups.google.com/group/maven-android-developers/browse_thread/thread/e7978fbf4e4b85f0?pli=1
This is where the apklib support in maven-android-plugin is documented:
http://code.google.com/p/maven-android-plugin/wiki/ApkLib
(be sure to read up on Google's official Android Library documentation which is linked from there too)
Look at the changelog for the latest version to use:
http://code.google.com/p/maven-android-plugin/wiki/Changelog
Related
When using Android Studio, I am aware that you can add dependencies like so:
Then you can search to find repositories, and Android Studio will notify you when you need to update the version of your library dependency.
I also have a library (currently on Bintray), but it doesn't appear in the library dependency list (as in the first screenshot) - is this because the list shows libraries from Maven Central?
If so, how would I go about putting my library on Maven Central? I have looked at some results on Google, but different blog pages and tutorials show different steps, so it can be very confusing.
Since my library (view on GitHub) is using the Novoda Bintray Release plugin, I have tried following the instructions from this wiki page to add my library to Maven Central, but I'm not really sure where to go from here.
So, to summarise, what I am asking is:
Do I need to upload my library to Maven Central?
If so, how would I do that? Should I carry on using the Novoda plugin, or should I switch to something easier to use.
The current default maven repository for android gradle plugin is not Maven Central, but JCenter, and this is probably what you are looking for. If you currently have a library deployed to your maven repository on Bintray, publishing to JCenter (also managed by Bintray) is very easy and requires clicking a button, describing your library and waiting for approval. The whole process is neatly explained here.
I made a android library in github that i want to add to Gradle,
that other people can add
compile "my project ..."
to there android build.
how can i upload it to Gradle?
(I didn't find an answer for this anywhere)
EDIT:
To clear my question, I want to release a library for developers.
Thanks
You don't "upload a library to gradle" ;-), you make it accessibla via gradle, so you first have to compile your library and publish the generated artefacts (aar or jar files) to a central repository, like Maven Central.
There are two common Maven repositories at time of this writing:
Maven Central http://search.maven.org/
JCenter https://bintray.com/bintray/jcenter
See this guide as a direction for mavenCentral:
http://www.vandalsoftware.com/post/52468430435/publishing-an-android-library-aar-to-a-maven
Since recent Android Studio versions, JCenter is the preferred default repository, so you may register there and upload your archives to it, like explained here:
https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/
Hope that helps.
The easiest way to expose your library to other developers is by using the JitPack service.
The requirement is that you create a GitHub release and that you have a build file in your repository. It doesn't require that you upload your library.
Does anyone have an idea if it's possible to use a github repo as a dependency, without it being published to maven central.
Let's say I'm developing an android library that has it's own github repo. I'd like to be able to "compile" this library has gradle dependency, in my android studio project, without having to publish to maven central (at least for the moment).
In other words : I want to use a dependency that is not on maven central. It's a straight github repo (an android library that also uses gradle).
I'd like my build.gradle to do something like this :
dependencies {
// Google Play Services (normal dependency)
compile "com.google.android.gms:play-services:5.2.08"
// The library I want to pull from github
compile "path_to_my_github_repo"
}
Thanks!
You can do that with Jitpack with Maven, Gradle and sbt.
However, I would strongly suggest to use binary artifact instead so that you are guaranteed that it is the same upon each build of your application, you control the artifact storage and you are using the official release of a project and not some downstream build. It will also make your builds much faster and more stable.
Publishing to the Central Repository is free, easy and well documented at e.g. http://central.sonatype.org/pages/producers.html and specifically for Gradle at http://central.sonatype.org/pages/gradle.html. You can also find lots of real world examples on the Nexus community site.
If you do not control the project you want to consume, I would suggest to send these pointers to the project and maybe even help them with a pull request ;-)
This should be possible and there is an unofficial gradle plugin called Gradle Git Repo plugin that claims to do what you're looking for. Note however, that I did not play with it myself to verify that it works.
What you need to use is a binary repository. It will contain your dependencies during development.
If you plan to publish your package to jcenter (and maven central) eventually, you can get a free Artifactory account in oss.jfrog.org.
Once doing that, your CI server can deploy your dependency to it and Gradle will resolve it from there.
I know this must be a pretty basic question, but I'm new to Android Studio and gradle, and I can't find any up-to-date info on this.
I'm trying to add this library to my project: android-segmented-control.
It doesn't look like I can add it to my build.gradle file (correct?). I'd like to do it that way, of course, and not download the project if possible.
If I do need to download the project, how do I link it up with my existing project? Again, I haven't been able to find anything that is current that describes this process for Android Studio 0.5.3
The library you mentioned does not seems to be pushed on maven central or any other maven repository. As this library contains resources files, you cannot add it as a jar.
The only way to use it is clone the git repository and add it as a module to your android app project.
Meanwhile, you can ask the author to make it available on a Maven repository like OSS sonatype
Thanks #Thomas Bouron for the hint !
I have pushed my library to maven center, so you just need to add the following dependency to your build.gradle.
dependencies {
compile 'info.hoang8f:android-segmented:1.0.0'
}
(A little late for #workInAFishBowl but it may be helpful for others.).
I've tried to find a solution for my problem but I haven't found it yet.
I'm working on a project that only compiles against Android 3.0, uses Android Library Projects, which are now supported by the maven-android-plugin and also uses AspectJ.
From maven-android-plugin website,
"The currently valid dependencies versions are 1.5_r4, 1.6_r2, 2.1.2 and 2.2.1"
I want to create a Maven 3 configuration for a project in this conditions.
Any hints?
I'm using maven-android-plugin 3.0.0-alpha-7.
Here is a sample provided by maven-android-plugin that you can start with (you need LibraryProjects in 2.9.0-beta download), btw, the website is out of date, I am using 2.3.3 in my current project.