Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?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>

    <parent>
        <groupId>org.osmdroid</groupId>
        <artifactId>osmdroid-parent</artifactId>
        <version>3.0.8</version>
    </parent>

    <artifactId>OpenStreetMapViewer</artifactId>
    <packaging>apk</packaging>

    <name>OpenStreetMap viewer</name>

    <dependencies>
        <!-- Android included libraries -->
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android-test</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>osmdroid-android</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>osmdroid-third-party</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-android</artifactId>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${basedir}/src</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
	
        <profile>
            <id>release</id>
            <!-- via this activation the profile is automatically used when the release is done with the maven release plugin -->
            <activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
            </activation>
			<build>
				<plugins>
					
					<!-- sign the release apk -->
					<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}/${project.artifactId}.apk</include>
									</includes>
									<!-- these properties should be defined in settings.xml -->
									<keystore>${osmdroid.sign.keystore}</keystore>
									<alias>${osmdroid.sign.alias}</alias>
									<storepass>${osmdroid.sign.storepass}</storepass>
									<keypass>${osmdroid.sign.keypass}</keypass>
									<verbose>true</verbose>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- zipalign the signed apk -->
					<plugin>
						<groupId>com.jayway.maven.plugins.android.generation2</groupId>
						<artifactId>maven-android-plugin</artifactId>
						<inherited>true</inherited>
						<configuration>
							<sign>
								<debug>false</debug>
							</sign>
							<zipalign>
								<verbose>true</verbose>
								<inputApk>${project.build.directory}/${project.artifactId}.apk</inputApk>
								<outputApk>${project.build.directory}/${project.artifactId}-signed-aligned.apk
								</outputApk>
							</zipalign>
						</configuration>
						<executions>
							<execution>
								<id>alignApk</id>
								<phase>package</phase>
								<goals>
									<goal>zipalign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>            

					<!-- publish the release apk -->
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<configuration>
							<artifacts>
								<artifact>
									<file>${project.build.directory}/${project.artifactId}-signed-aligned.apk</file>
									<type>apk</type>
									<classifier>signed-aligned</classifier>
								</artifact>
							</artifacts>
						</configuration>
						<executions>
							<execution>
								<id>attach-signed-aligned</id>
								<phase>package</phase>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
							</execution>
						</executions>
					</plugin>            
					
				</plugins>
			</build>
		</profile>
    </profiles>
    
</project>
New to GrepCode? Check out our FAQ X