Skip to content

Instantly share code, notes, and snippets.

@imbeyondboredom
Created March 30, 2013 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imbeyondboredom/5278139 to your computer and use it in GitHub Desktop.
Save imbeyondboredom/5278139 to your computer and use it in GitHub Desktop.
This is a maven pom example for a blog post
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<sign>
<debug>false</debug>
</sign>
<manifest>
<debuggable>false</debuggable>
<versionCode>${app.versioncode}</versionCode>
<versionName>1.1.5-SNAPSHOT</versionName>
<versionCodeAutoIncrement>false</versionCodeAutoIncrement>
</manifest>
<proguard>
<skip>true</skip>
</proguard>
</configuration>
<executions>
<execution>
<id>manifestUpdate</id>
<phase>process-resources</phase>
<goals>
<goal>manifest-update</goal>
</goals>
</execution>
<execution>
<id>alignApk</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
</plugin>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>${platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.willowtreeapps</groupId>
<artifactId>oak-library</artifactId>
<version>1.1.5-SNAPSHOT</version>
</dependency>
</dependencies>
<groupId>com.company.name</groupId>
<!--ideally, we'd like this to follow the format of "PROJECTNAME-android"-->
<artifactId>projectname</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>projectname</name>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.name</groupId>
<!--ideally, we'd like this to follow the format of "PROJECTNAME-android"-->
<artifactId>projectname</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>projectname</name>
<properties>
<platform.version>4.1.1.4</platform.version>
<!-- you'll need to generate a keystore and put it at the root of your project and change these -->
<sign.keystore>PROJECT_KEYSTORE_FILE.keystore</sign.keystore>
<sign.keyalias>PROJECT_KEY_ALIAS</sign.keyalias>
<!-- the following values will be overwritten on the command line when using the "sign" profile (in CI) -->
<sign.storepass>DONT_ACTUALLY_PUT_THE_PASSWORD_HERE</sign.storepass>
<sign.keypass>DONT_ACTUALLY_PUT_THE_PASSWORD_HERE</sign.keypass>
<app.versioncode>9999</app.versioncode>
</properties>
<scm>
<!--The following is needed for auto-tagging for "mvn release:prepare"-->
<!--<developerConnection>scm:git:git@github.com:username/PROJECT_NAME.git</developerConnection>-->
<!--<tag>HEAD</tag>-->
</scm>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>${platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.willowtreeapps</groupId>
<artifactId>oak-library</artifactId>
<version>1.1.5-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml
</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native
</nativeLibrariesDirectory>
<sdk>
<platform>16</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
<goal>verify</goal>
</goals>
<phase>package</phase>
<inherited>true</inherited>
<configuration>
<removeExistingSignatures>true</removeExistingSignatures>
<archiveDirectory/>
<keystore>${sign.keystore}</keystore>
<alias>${sign.keyalias}</alias>
<storepass>${sign.storepass}</storepass>
<keypass>${sign.keypass}</keypass>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<sign>
<debug>false</debug>
</sign>
<manifest>
<debuggable>false</debuggable>
<versionCode>${app.versioncode}</versionCode>
<versionName>1.1.5-SNAPSHOT</versionName>
<versionCodeAutoIncrement>false</versionCodeAutoIncrement>
</manifest>
<proguard>
<skip>true</skip>
</proguard>
</configuration>
<executions>
<execution>
<id>manifestUpdate</id>
<phase>process-resources</phase>
<goals>
<goal>manifest-update</goal>
</goals>
</execution>
<execution>
<id>alignApk</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<properties>
<platform.version>4.1.1.4</platform.version>
<!-- you'll need to generate a keystore and put it at the root of your project and change these -->
<sign.keystore>PROJECT_KEYSTORE_FILE.keystore</sign.keystore>
<sign.keyalias>PROJECT_KEY_ALIAS</sign.keyalias>
<!-- the following values will be overwritten on the command line when using the "sign" profile (in CI) -->
<sign.storepass>DONT_ACTUALLY_PUT_THE_PASSWORD_HERE</sign.storepass>
<sign.keypass>DONT_ACTUALLY_PUT_THE_PASSWORD_HERE</sign.keypass>
<app.versioncode>9999</app.versioncode>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
<goal>verify</goal>
</goals>
<phase>package</phase>
<inherited>true</inherited>
<configuration>
<removeExistingSignatures>true</removeExistingSignatures>
<archiveDirectory/>
<keystore>${sign.keystore}</keystore>
<alias>${sign.keyalias}</alias>
<storepass>${sign.storepass}</storepass>
<keypass>${sign.keypass}</keypass>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml
</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native
</nativeLibrariesDirectory>
<sdk>
<platform>16</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<scm>
<!--The following is needed for auto-tagging for "mvn release:prepare"-->
<!--<developerConnection>scm:git:git@github.com:username/PROJECT_NAME.git</developerConnection>-->
<!--<tag>HEAD</tag>-->
</scm>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment