Ability to port AndroidManifest.xml support for ADT plugin to Eclipse

I am trying to develop an android app 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 AndroidManifest.xml and res folder is in the root of the Android project. However, if these two are NOT in the root of the android project, the error will show that these files are missing.

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

The reason is that android-maven-plugin ver 4.x requires AndroidManifest.xml and res folder to be in src / main directory, otherwise it won't be created. is there a way also in android-maven-plugin 4.x ++ to customize AndroidManifest.xml location and res folder?

+3


source to share


2 answers


I found the answer.

Just in case someone is facing the same problem, the solution is really just a configuration in the Android-maven-plugin for <resourceDirectory/>

and <androidManifestFile/>

. Something like that:



<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>

      

+9


source


If you have your folder structure the old way, you can tell maven where to look. This is what worked for me (more 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>

      

0


source







All Articles