Reputation: 3645
I am using Maven for dependency management in my android projects and its great.
I want to use a 3rd party android library project (https://github.com/emilsjolander/StickyListHeaders) and rather than download the directory and add the dependency manually I want to change the StickyListHeaders project into a maven project (an apklib?).
Upvotes: 3
Views: 1561
Reputation: 6821
This project already has a pom.xml
, so to create the artifact you only have to do a mvn package
.
Here there is a detailed explanation of how to publish in Maven Central Respository.
When I have to use a non-maven library in my Maven projects I use a "folder repository". By "folder respository" I mean that I use one folder of my project (lib
or repo
sometimes) as a local repository.
For this you have to config a repository like that:
<repository>
<id>project</id>
<name>Project Maven Repository</name>
<layout>default</layout>
<url>file://${project.basedir}/lib</url>
</repository>
And then you can deploy the artifact into your local repository as this:
mvn install:install-file -Dfile=path-to-your-artifact-jar \
-DgroupId=your.groupId \
-DartifactId=your-artifactId \
-Dversion=version \
-Dpackaging=jar \
-DlocalRepositoryPath=path-to-specific-local-repo
Tip: When my project has multiple maven modules, then I use file://${project.basedir}/../lib
as a repository url
.
Upvotes: 2