使用Maven时,在Eclipse中更改输出文件夹为Android R.java [英] Change output folder for Android R.java in Eclipse when using Maven

查看:166
本文介绍了使用Maven时,在Eclipse中更改输出文件夹为Android R.java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用Maven的Andr​​oid插件的Andr​​oid项目的设置。这个插件坚持到Maven的输出文件夹为 R.java 文件的位置(即目标/生成,源/ R )。

I have an android project setup using the maven-android plugin. This plugin adheres to maven output folders for the location of the R.java file (i.e. target/generated-sources/r).

不过,使用这个项目在Eclipse中的时候,我无法配置AAPT依赖于该文件夹。

However, when using this project in Eclipse, I can't configure aapt to rely on that folder.

即使我手动进入项目属性,手动设置文件夹,ADT插件进去和重置的只是一些设置(即添加了 /根文件夹回为一个源文件夹,并恢复输出文件夹 /斌/班而不是 /目标/班),同时使行家 /目标/生成,源/ R 文件夹,并打破该项目的建设。

Even if I manually go into the project properties and set up the folders manually, the ADT plugin goes in and resets just some of the settings (i.e. adds the /gen folder back as a source folder, and restores the output folder to /bin/classes instead of /target/classes), while leaving the maven /target/generated-sources/r folder and breaking the build of the project.

我想使用默认的Maven的文件夹结构与Eclipse ADT。我如何能做到这一点任何想法?

I would like to use the default Maven folder structure with the Eclipse ADT. Any ideas on how I can do this?

感谢

回应的评论:

  • 是的,现在用的M2E-Android插件。
  • 由于ADT仍旧产生R.java在 / GEN ,Eclipse的失败来编译,如果仍然存在一个R.java根据目标/产生-源/ R 由于重复的类定义。
  • Yes, am using the m2e-android plugin.
  • Because ADT is still generating R.java in /gen, Eclipse is failing to compile if there still exists an R.java under target/generated-sources/r due to duplicated class definitions.

推荐答案

不幸的是, Android的连接器M2E 不支持移动所产生的文件夹,如ADT根文件夹到其他目录。这是ADT的限制,虽然有一票的方式探索这个限制的方式:

Unfortunately, the Android Connector for M2E does not support moving generated folders like the ADT gen folder to other directories. This is a restriction of the ADT, although there is a ticket to explore a way around this restriction:

https://github.com/rgladwell/m2e-android/issues/68

如果你想保持更新,请在这张票发表评论。

If you'd like to stay updated, please comment on this ticket.

这篇关于使用Maven时,在Eclipse中更改输出文件夹为Android R.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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