Using specified debug.keystore in Maven Android builds
Asked Answered
V

0

7

I know how to specify the release keystore in an Android Maven build but haven't had luck doing the same with a debug build.

The release build methodology can be found here - https://code.google.com/p/maven-android-plugin/wiki/SigningAPKWithMavenJarsigner.

When making debug builds, the android-maven-plugin's sign->debug configuration must be true, and the release configuration must be false, but when debug is set to true, the configuration of the maven-jarsigner-plugin seems to be ignored.

When using (android-maven-plugin):

<sign>
   <debug>true</debug>
</sign>

And specifying a key (maven-jarsigner-plugin):

<goals>
    <goal>sign</goal>
</goals>
<phase>package</phase>
<inherited>true</inherited>
<configuration>
    <archiveDirectory></archiveDirectory>
    <includes>
        <include>${basedir}/someFolder/target/*.apk</include>
    </includes>
    <keystore>${basedir}/someFolder/debug.keystore</keystore>
    <storepass>android</storepass>
    <keypass>android</keypass>
    <alias>androiddebugkey</alias>
</configuration>

The build will default to using the debug.keystore in my .android directory. If I delete/rename the debug.keystore there, it just creates the new one.

The reason I'd like to specify the debug.keystore is I'm working on a team of several people and we're using Google Maps v2. Having one access token in the Maps v2 API instead of one per team member is our desire.

Thanks

EDIT:

My current workaround is to package a script with my repo to replace their debug.keystore:

cp -r someFolder/debug.keystore ~/.android/debug.keystore
Vinson answered 5/8, 2013 at 15:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.