Change output folder for Android R.java in Eclipse when using Maven

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

However, when using this project in Eclipse, I cannot configure aapt to rely on this folder.

Even if I manually go to the project properties and configure the folders manually, the ADT plugin will turn on and reset only some of the settings (for example, add the folder /genback as the original folder and restore the output folder to /bin/classesinstead /target/classes), leaving the maven folder /target/generated-sources/rand breaking the project assembly.

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

thank


Responding to comments:

  • Yes, I am using the m2e-android plugin.
  • Since ADT still generates R.java in /gen, Eclipse will not compile if R.java underneath still exists target/generated-sources/rdue to duplicate class definitions.
+5
source share
2 answers

Unfortunately, the Android Connector for M2E does not support moving generated folders, such as the ADT gen folder, to other directories. This is an ADT limitation, although there is a ticket to explore the path around this limitation:

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

, .

+4

, :

ADT gen , /target/classes.

eclipse, maven , R . , Eclipse R.java /gen, maven /target/generated-sources/r, R.class /target/classes.

: - /gen pom.xml build-helper-maven-plugin, .

+1

All Articles