Signing apk with maven-jarsigner-plugin

2.4k views Asked by At

I followed this tutorial and configured maven to sign my apk.

Here is a part of my pom.xml

            <!-- Maven plugin which is responsible for signing apks -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <executions>
                <execution>
                    <id>signing</id>
                    <goals>
                        <goal>sign</goal>
                        <goal>verify</goal>
                    </goals>
                    <phase>package</phase>
                    <inherited>true</inherited>
                    <configuration>
                        <removeExistingSignatures>true</removeExistingSignatures>
                        <archiveDirectory/>
                        <includes>
                            <include>${project.build.directory}/eticapp-1.0.0-SNAPSHOT.apk</include>
                        </includes>
                        <keystore>d:\My Docs\KeyStore\EtickAppKeystore</keystore>
                        <alias>ekey</alias>
                        <storepass>1234abcd</storepass>
                        <keypass>123abc</keypass>
                        <verbose>true</verbose>
                        <arguments>
                          <argument>-sigalg</argument><argument>MD5withRSA</argument>
                          <argument>-digestalg</argument><argument>SHA1</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Indeed when I am trying to execute the goals:

jarsigner:sign jarsigner:verify

I get an Exception about failing alias, which is clearly set. Any solutions for that?

Failed to execute goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign (default-cli) on project eticapp: The parameters 'alias' for goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign are missing or invalid -> [Help 1]
1

There are 1 answers

0
Skip On BEST ANSWER

The solution was not to use quotatin marks in my alias and password!