0

I configured some plugin goals to be executed during some phases of my build lifecycle (maven android application). But i think that i take a mistake during configuring plugin and want to ensure that they really called. I found this command which will print all lifecycle phases and goals: mvn help:describe -Dcmd=install, but it doesn't show my goals which i configure. Therefore i have two quistions:

  • Does mvn help:describe -Dcmd=install command show goals which i configured inside <build>/<plugins>/<plugin>/<executions>/<execution> pom tag?

  • How to ensure that goal called during phase and phase called during build lifecycle?

UPDATE I'm trying configure maven-android-plugin and want to execute zipalign goal at package phase

        <plugin>
            <groupId>com.jayway.maven.plugins.android.generation2</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>3.2.0</version>
            <extensions>true</extensions>
            <configuration>
                <sdk>
                    <platform>8</platform>
                </sdk>
                <emulator>
                    <avd>2.3.3_API-10</avd>
                </emulator>
                <undeployBeforeDeploy>true</undeployBeforeDeploy>
                <assetsDirectory>${project.build.directory}/filtered-assets</assetsDirectory>
                <androidManifestFile>${project.build.directory}/filtered-manifest/AndroidManifest.xml</androidManifestFile>
                <zipalign>
                    <skip>false</skip>
                    <verbose>${build.verbosity}</verbose>
                    <inputApk>${project.build.directory}/${project.artifactId}-${build.version.name}.apk</inputApk>
                    <outputApk>${project.build.directory}/${project.artifactId}-${build.version.name}-aligned.apk</outputApk>
                </zipalign>
            </configuration>
            <executions>
                <execution>
                    <id>zipalign</id>
                    <phase>package</phase>
                    <goals>
                        <goal>zipalign</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
j0k
  • 22,600
  • 28
  • 79
  • 90
Dmitriy Tarasov
  • 1,949
  • 20
  • 37

1 Answers1

6

You can see that in a maven goal is called in the logs. For your case with zipalign you can see for example:

[INFO] --- android-maven-plugin:3.5.0:zipalign (alignApk) @ androidclientlight ---
[INFO] Running command: C:\Eclipse\Android\android-sdk-windows_r12\tools\zipalign.exe
[INFO] with parameters: [-v, -f, 4, 

If this is skipped you will see:

[INFO] --- android-maven-plugin:3.5.0:zipalign (alignApk) @ androidclientlight ---
[INFO] Skipping zipalign

A hint, don't forget to add flag "false" in your zipalign config.

      <zipalign>
        <skip>false</skip>
        <verbose>true</verbose>
        <inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk>
        <outputApk>${project.build.directory}/${project.artifactId}-release-v${project.version}.apk</outputApk>
      </zipalign>
L. G.
  • 9,642
  • 7
  • 56
  • 78