在Android项目整合Maven项目 [英] Integrating maven project in Android project
问题描述
我建立一个Android应用程序,我想使用在Maven项目提供的某些功能。
I am building an Android application, and I want to use certain functionalities that are supplied in a Maven project.
什么是我的Android项目中使用这个Maven项目最简单的方法?我从来没有与Maven的工作,所以我preFER对付它尽可能少的。
What is the easiest way to use this maven project in my Android project? I have never worked with Maven so I prefer to deal with it as little as possible.
我试着使用eclipse导出Maven项目成一个罐子,然后用它来我的Android的项目构建路径,但是当我运行它,我得到java.lang.NoClassDefFoundError的。info.bliki.api.User
I tried exporting the maven project into a jar using eclipse and then using it to my android's project build path, but when I run it I get java.lang.NoClassDefFoundError: info.bliki.api.User.
所以,这将是在我的Android项目使用这个Maven项目最简单的方法?
So what would be the easiest way to use this Maven project in my Android project?
推荐答案
好吧,我想你是在产生的神器只是有兴趣,那么你应该能够只需在命令行中运行(你需要有一个版本虽然Maven的运行)的
Well, i guess you're just interested in the resulting artifact, then you should be able to just run in the command line (you need to have a version of Maven running though)
mvn install
该编译并生成项目。你会得到一个本地副本直接写入到〜/ .m2目录/ ......这是所有Maven工件安装到。然后,您可以只抓得到的罐子(如果它是一个)或直接链接到所产生的假象。
which compiles and build the project. You'll get a local copy directly written into ~/.m2/ ... this is where all maven artifacts are installed to . You could then just grab the resulting jar (if it is one) or link directly to the resulting artifact.
这篇关于在Android项目整合Maven项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!