如何在Eclipse中构建一个Maven Android项目 [英] How to build a Maven Android project in eclipse

查看:269
本文介绍了如何在Eclipse中构建一个Maven Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试了code在这里:<一href="https://github.com/nkzawa/socket.io-client.java">https://github.com/nkzawa/socket.io-client.java.根据功能有这甜蜜动听行:Android正在全力支持。但作为全新到Maven我可以让没有头的指示,也没有尾巴。如何建立一个基本的Andr​​oid测试项目与此code?只需从回购到我的项目添加源$ C ​​$ C正显示出很多错误。如果这样做的命令行的方式,将被罚款了。

I am testing the code here : https://github.com/nkzawa/socket.io-client.java. Under features there is this sweet sounding line : "Android is fully supported". But being completely new to maven I can make neither head nor tail of the instructions. How do I build a basic Android test project with this code? Simply adding the source code from the repo to my project is showing lot of errors. If there is a command line way of doing this that would be fine too.

推荐答案

Android的Maven的Eclipse的连接器是一个Maven的Eclipse的(M2E)插件,它增加了对Android开发工具Maven支持(ADT )和Maven的Andr​​oid插件。它带来Maven的依赖管理的能力进入ADT。

The Android for Maven Eclipse connector is an Maven Eclipse (m2e) plug-in that adds maven support for Android Developer Tools (ADT) and the Maven Android Plugin. It brings the power of Maven dependency management into the ADT.

  1. 开始之前

您需要安装Eclipse的靛蓝或朱诺。

You will need Eclipse Indigo or Juno installed.

安装Android的连接器

  • 您可以通过Eclipse市场安装Android连接器的Maven。选择帮助 - > Eclipse的市场......并搜索机器人M2E

  • You can install the Android Connector for Maven via the Eclipse Marketplace. Select Help -> Eclipse Marketplace... and search for "android m2e".

点击安装按钮旁边的Andr​​oid连接器Maven的出现,并按照在向导对话框的路径,安装插件和它的依赖(包括Android开发工具包和Maven的Eclipse的插件M2E在)。接受条款,和条件,并单击Finish。

Click the Install button next to the Android Connector for Maven that appears and follow the path through the wizard dialog to install the plug-in and its dependencies (including the Android Development Toolkit and the Maven for Eclipse m2e plug-in). Accept the terms-and-conditions and click Finish.

在您重新启动Eclipse工作区,你应该准备好开始使用Android连接器。

Once you restart your Eclipse workspace you should be ready to start using the Android Connector.

创建Eclipse项目

  • 如果您已经有一个Android项目,请确保您已经创建了一个POM使用3.0.0或更高版本的Maven的Andr​​oid的插件项目。

  • If you already have an Android project please make sure you have created a POM for your project using version 3.0.0 or greater of the maven-android-plugin.

然后在你的项目上单击右键并选择配置 - >转换为Maven项目

Then right-click on your project and select Configure -> Convert to Maven Project.

如果你开始一个新项目,你可以使用Maven Android的原型完全在Eclipse中创建的Andr​​oid项目:


If you are starting with a new project you can use the Maven Android archetypes to create Android projects completely within Eclipse:

1. Create a new Maven Project (File -> New -> Project... then select Maven -> Maven Project).
2. When prompted to Select Archetype click Add Archetype...
3. In the dialog that appears enter "de.akquinet.android.archetypes" for Archetype Group Id.
4. In Archetype Artifact Id enter "android-quickstart".
5. In Archetype Version enter "1.0.10" and continue.
6. When prompted enter your desired project group and artifact ID, version and, optionally, set the "platform" property for the Android version (defaults to '16').
7. Click Finish

您应该结束了Eclipse项目看起来像这样无论哪种方式:

Either way you should end up with an Eclipse project looking something like this:

这篇关于如何在Eclipse中构建一个Maven Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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