How do I add dependencies for 3rd party jar files in maven for Android. Some jars are not available in maven central. Any idea?
Asked
Active
Viewed 78 times
1 Answers
0
You add them in your pom.xml as such...
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>2.2.1</version>
<scope>provided</scope>
</dependency>
.. add to here ..
</dependencies>
you can look up the libs you want here http://search.maven.org/
If they are not available there you can download the source and install them to your local repo. Learn about the Maven Lifecycle here.
If you have a precompiled jar you can try this solution; Add compiled java class to a maven project

Community
- 1
- 1

jeremyjjbrown
- 7,772
- 5
- 43
- 55
-
Thanks Jeremy, some jars arent available in Maven central. And to add the jar to local repo, there has to be a pom.xml included with the jar, which is not available. – Rajashri Feb 08 '14 at 00:30
-
The pom.xml comes with the source. What jar's do you need? Can you list them? – jeremyjjbrown Feb 08 '14 at 00:32
-
Its a library provided by the client. The name is gpm-crypto. Sorry to say cant provide you the jar. – Rajashri Feb 08 '14 at 00:51
-
Resolved. I created the pom file manually, added to the jar and installed in my local repo. Thanks – Rajashri Feb 08 '14 at 01:07
-
Great! if you think I helped you could accept and/or upvote. You get points for accepting an answer. – jeremyjjbrown Feb 08 '14 at 01:09