Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know the exact reason, but it looks like properties-maven-plugin can substitute the property value properly defined under properties tag in pom.xml, and maven can only recognize the properties name explicitly defined in pom.xml, the following pom works for me: </p> <pre><code>&lt;properties&gt; &lt;!-- use property name defined in your buildNumber.properties --&gt; &lt;external.build.version&gt;${major_version}&lt;/external.build.version&gt; &lt;/properties&gt; ... ... &lt;build&gt; &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt; &lt;!-- use property name defined earlier in this pom.xml --&gt; &lt;finalName&gt;myapk.${external.build.version}&lt;/finalName&gt; ... ... </code></pre> <p><strong>EDIT:</strong><br> From my point of view, The predefined build lifecycle of maven is quite exclusive especially when integrating with other build tools like ADT, the pom version used for generating the apk is quite restricted, moreover, from the <a href="http://maven-android-plugin-m2site.googlecode.com/svn/apk-mojo.html#configurations" rel="nofollow noreferrer">plugin documentation</a>, current version of android-maven-plugin does not provide any configuration for customizing the final apk name during apk goal. A similar discussion was posted <a href="https://stackoverflow.com/questions/8541332/maven-read-version-number-from-property-file/8541612#8541612">here</a> end up with a not so perfect answer.</p> <p>As a last shot, android-maven-plugin provide options to customize the final apk name during zipalign goal:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt; &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt; &lt;extensions&gt;true&lt;/extensions&gt; &lt;configuration&gt; &lt;sdk&gt; &lt;platform&gt;13&lt;/platform&gt; &lt;/sdk&gt; &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt; &lt;zipalign&gt; &lt;verbose&gt;true&lt;/verbose&gt; &lt;inputApk&gt;${project.build.directory}/${project.artifactId}-${project.version}.apk&lt;/inputApk&gt; &lt;!-- directly use property name defined in external properties file here --&gt; &lt;outputApk&gt;${project.build.directory}/${project.artifactId}-${major_version}-aligned.apk&lt;/outputApk&gt; &lt;/zipalign&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;alignApk&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;zipalign&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>This could be a solution if you use maven zipalign your final apk (I suppose you do), you will get all three output files (.ap_ and .apk and .jar) end with the default ${project.version} plus another apk end with ${major_version}-aligned, however only those three with the default ${project.version} will get installed in the maven central repository.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload