结合Maven的/ ANT +常春藤的敏感性建立双平台桌面/ Android的部署管理? [英] Sensibility of combined Maven/Ant+Ivy build management for dual platform Desktop/Android deployment?

查看:106
本文介绍了结合Maven的/ ANT +常春藤的敏感性建立双平台桌面/ Android的部署管理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前preparing启动一个新项目,并想知道的构建管理工具的选择。(Maven和蚂蚁+艾维的非排他性的替代品)

的一般方案如下:


  • 小,几​​个人的项目,

  • 所有的开发人员使用Eclipse作为IDE,

  • 两个目标:机器人(主)和Java SE,

  • 我们会在CI(詹金斯特别),所以还需要一些构建管理的。

关于设想项目结构:


  • 一个总的模块,与大多数code和共同的依赖,

  • 一款使用Android操作系统专用模块,采用Android特有DEPS和code,

  • 一个特定的台式机模块,具体桌面DEPS和code。

和非技术方面的考虑:


  • 在项目中我负责构建管理和CI的人,

  • 我有经验,在同时使用Maven和Ant的,但在配置多练习前,

  • 只有常春藤的基本知识,

  • 我已经很复杂的经验与使用Maven为Android构建,尤其是与Eclipse的互操作有关。


  

目前看起来最好的选择是使用


  
  

      
  1. 的Maven为基础(和桌面)项目,

  2.   
  3. 蚂蚁+艾维的Andr​​oid项目。

  4.   

在表面上看起来它会很好,但我的直觉告诉我涉及到这么多的技术可能最终在实践中是痛苦的。

要总结,我的问题是:

给定的条件,它是确定使用的块引用中描述的设置,或者我们应该去纯粹的Maven / ANT +常春藤(如果是这样,哪一个,为什么)?


解决方案

哪一个?

我会去用纯净的Maven的方法。

为什么?

您描述的场景是完全适合到聚合(或者多模块)项目,从我自己的经验,比较用Ant,Maven提供了模块间的依赖关系管理多模块项目更有效的,合理的和本地的方式。

您的项目结构:

 我的项目/
  共LIB /< - 经典的Java项目,建设成为一个JAR库
  桌面应用程序/< - 经典的Java项目,建设成为一个罐子应用
  Android的应用程序/< - Android项目,建立一个应用程序的apk
  Android的应用程序测试/< - Android的测试项目,建立一个应用程序的apk
  的pom.xml

您根的pom.xml:

 <模块>
  <&模块GT;共LIB和LT; /模块>
  <&模块GT;桌面应用程序和LT; /模块>
  <&模块GT; Android的应用程序和LT; /模块>
  <&模块GT; Android的应用程序测试和LT; /模块>
< /模块>

使用 Android的Maven的插件,则可以维护释放标准和统一的多模块项目(更多precisely,Android的Maven的插件,用于构建针对Android子模块项目发布)的命令行交叉的团队。

通过使用两个Eclipse插件:M2E和M2E-的Andr​​oid(通过Eclipse市场上所有可用),可以保持进口标准和统一的方式/开发/调试在Eclipse中跨团队的多模块项目

正如Maven是合格用于管理的一切,就没有必要使用Ant +艾维

I'm currently preparing to start a new project and wondering about the choice of build management tools (non-exclusive alternatives of Maven and Ant+Ivy).

The general scenario is as follows:

  • small, several-person project,
  • all developers use Eclipse as the IDE,
  • two targets: Android (primary), and Java SE,
  • we'll be in CI (Jenkins specifically), so some sort of build management is required.

Regarding the envisioned project structure:

  • one general module, with most of the code and common dependencies,
  • one Android-specific module, with Android-specific deps and code,
  • one desktop-specific module, with desktop-specific deps and code.

And the non-technical considerations:

  • in the project I'm the person responsible for build management and CI,
  • I've got experience in using both Maven and Ant, but more practice in configuring the former,
  • only basic knowledge of Ivy,
  • I've had very mixed experiences with using Maven for Android builds, especially regarding interop with Eclipse.

Currently it looks like the best choice would be to use:

  1. Maven for the base (and desktop) project,
  2. Ant+Ivy for the Android project.

On the surface it seems like it will go fine, but my intuition tells me involving so many technologies might end up being painful in practice.

To summarize, my question is:

Given the conditions, is it OK to use the setup described in the blockquote, or should we go pure Maven/Ant+Ivy (and if so, which one and why)?

解决方案

Which one?

I would go with pure Maven approach.

Why?

The scenario you described is perfectly fit into an Aggregation (or Multi-Module) Project, From my own experience, compare with Ant, Maven provides a more efficient, reasonable and native way for managing multi-module project with inter-module dependencies.

Your project structure:

my-project/
  common-lib/  <-- classic Java project, build as a jar library
  desktop-app/  <-- classic Java project, build as a jar application
  android-app/  <-- Android project, build as a apk application
  android-app-test/ <-- Android Test project, build as a apk application
  pom.xml

Your root pom.xml:

<modules>
  <module>common-lib</module>
  <module>desktop-app</module>
  <module>android-app</module>
  <module>android-app-test</module>
</modules>

By using android-maven-plugin, you can maintain a standard and unified way for release your multi-module project (more precisely, android-maven-plugin is used for building release for Android sub-module project) from command-line cross team.

By using two eclipse plugins: m2e and m2e-android (all available via Eclipse Marketplace), you can maintain a standard and unified way for import/develop/debug your multi-module project in Eclipse cross team.

As Maven is qualified for managing everything, there is no need to use Ant+Ivy.

这篇关于结合Maven的/ ANT +常春藤的敏感性建立双平台桌面/ Android的部署管理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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