Signing apk with maven-jarsigner-plugin. Alias not found.

595 views
Skip to first unread message

Alexander Friesen

unread,
Sep 3, 2013, 6:42:14 AM9/3/13
to maven-androi...@googlegroups.com

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?


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

Fredrik Jonson

unread,
Sep 15, 2013, 1:34:41 AM9/15/13
to maven-androi...@googlegroups.com
On 2013-09-03 at 3:42, scha...@gmail.com wrote:

> I followed this tutorial
> <http://www.simpligility.com/2010/07/sign-zipalign-and-to-market-to-market-with-maven>
> and configured maven to sign my apk. [W]hen I am trying to execute the goals:
>
> jarsigner:sign jarsigner:verify
>
> I get an Exception about failing alias, which is clearly set.
>
> 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]

In the tutorial the jarsigner is configured in a profile. Did you make sure to
activate that profile when executing the jarsigner goals? Use '-P' to specify
which profiles to activate. Assuming the profile is named 'release', use:

mvn -P release jarsigner:sign

If you instruct maven to build with the debug flag, it will print the jarsigner
configuration, and you can see if the alias configuration is set:

mvn -X -P release jarsigner:sign

--
Fredrik Jonson
Reply all
Reply to author
Forward
0 new messages