在eclipse中包含maven依赖项“Run As - > Android应用程序“建立 [英] Include maven dependencies in eclipse "Run As -> Android Application" build

查看:241
本文介绍了在eclipse中包含maven依赖项“Run As - > Android应用程序“建立的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用eclipse开发一个Android应用程序, Android开发工具(ADT)插件 maven-android-plugin

I develop an Android App using eclipse, the Android Development Tools (ADT) plugin and the maven-android-plugin.

在命令行上构建和安装应用程序( mvn install / adb install )工作正常 - 特别是它包括在pom.xml中指定的所有依赖项。

Building and installing the application on the commandline (mvn install / adb install) works fine - especially it includes all dependencies specified in the pom.xml.

通过eclipse(运行为 - > Android应用程序)将应用程序部署到Android不会自动将依赖关系放在apk文件中 - 尽管在pom.xml中指定。我希望在eclipse项目 Build Path - > Libraries 对话框中明确声明它们。

Deploying the application to Android via eclipse (Run as -> Android Application) does not automatically put the dependencies in the apk file - although specified in the pom.xml. I haven to explicit declare them in the eclipse project Build Path -> Libraries dialog.

有没有办法make eclipse包含在 pom.xml 中定义的依赖关系,而不是在项目中定义两次:构建路径 - >库?

Is there a way to make eclipse include the dependencies defined in the pom.xml without definig them twice in the project Build-Path -> Libraries?

编辑:要澄清 - eclipse项目包括一个Maven Dependencies条目,其中包含pom.xml中指定的所有依赖项。但是,通过运行为 - > Android应用程序安装期间,这些依赖关系将不会包含在apk中。要包括它们,必须在Java Build Path - > Libraries对话框中额外添加每个。这是痛苦!

To clarify - the eclipse project includes a "Maven Dependencies" entry with all dependencies specified in the pom.xml. But these dependencies will not be included in the apk during install via "Run As -> Android Application". To include them, each one has to be extra added in the "Java Build Path -> Libraries" dialog. That's the pain!

推荐答案

也许你应该看看 m2e-android ,假设您已经在使用 M2Eclipse

Perhaps you should look at m2e-android, assuming you are already using M2Eclipse.

这篇关于在eclipse中包含maven依赖项“Run As - > Android应用程序“建立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆