3
votes

I'm attempting to develop an Android application using the following:

Eclipse Luna 4.4.0 Latest ADT plugin (https://dl-ssl.google.com/android/eclipse/) Maven + android-maven-plugin 4.0.0-rc.2

in Eclipse IDE, everything works fine if the AndroidManifest.xml and res folder is located in the root of the android project. However, if these two are NOT located in the root of the android project, an error will show stating those files are missing.

is there a way, in ADT plugin to configure the location of AndroidManifest.xml and res folder? Basically, I want to move it to src/main directory.

Reason being, is because the android-maven-plugin ver 4.x requires that AndroidManifest.xml and res folder should be in src/main directory or else it wont build. is there a way also in android-maven-plugin 4.x++ to configure the location of AndroidManifest.xml and res folder?

2
Guys, please note we will support non-ADT paths with android-maven-plugin 4.0.0 soon in m2e-android (actually it already works if you explicitly declare the path in androidManifestFile).WonderCsabo

2 Answers

9
votes

I found the answer.

Just in case somebody encounters the same concern, the solution actually is just a configuration in android-maven-plugin for <resourceDirectory/> and <androidManifestFile/>. Something like this:

<plugin>
  <groupId>com.simpligility.maven.plugins</groupId>
  <artifactId>android-maven-plugin</artifactId>
  <version>${android-plugin-version}</version>
  <extensions>true</extensions>
    <configuration>
      <sign><debug>both</debug></sign>
      <resourceDirectory>${basedir}/res</resourceDirectory>
      <androidManifestFile>${basedir}/AndroidManifest.xml</androidManifestFile>
    </configuration>
 </plugin>
0
votes

If you have folder structure in the old way, you can tell maven where to look. This is what worked for me(details here):

<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>...</version>
<extensions>true</extensions>
    <configuration>
        ...
        <resourceDirectory>${project.basedir}/res</resourceDirectory>
        <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
        <assetsDirectory>${project.basedir}/assets</assetsDirectory> 
        <genDirectory>${project.basedir}/gen</genDirectory>
        <nativeLibrariesDirectory>${project.basedir}/lib</nativeLibrariesDirectory>
    </configuration>
</plugin>