<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
  Systems and Internet Infrastructure Security Laboratory

  Author: Damien Octeau

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>edu.psu.cse.siis</groupId>
  <artifactId>ic3</artifactId>
  <version>0.1.0</version>

  <name>IC3: Inter-Component Communication Analysis in Android</name>
  <description>The IC3 tool for inferring Inter-Component Communication in Android</description>
  <url>http://siis.cse.psu.edu/ic3/</url>

  <organization>
    <name>Systems and Internet Infrastructure Security Laboratory</name>
    <url>http://siis.cse.psu.edu</url>
  </organization>

  <developers>
    <developer>
      <name>Damien Octeau</name>
    </developer>
  </developers>

  <repositories>
    <repository>
      <id>soot-repo</id>
      <url>https://raw.github.com/siis/soot/mvn-repo/</url>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </snapshots>
    </repository>
  </repositories>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <licenses>
    <license>
      <name>Apache 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://github.com/siis/ic3.git</connection>
    <developerConnection>scm:git:git@github.com:siis/ic3.git</developerConnection>
    <url>https://github.com/siis/ic3</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.3.2</version>
        <executions>
          <!-- Compile the ICC model to a single, binary file. -->
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>java</goal>
            </goals>
            <configuration>
              <mainClass>edu.psu.cse.siis.coal.ModelCompiler</mainClass>
              <arguments>
                <argument>${basedir}/src/main/resources/model</argument>
                <argument>${basedir}/target/classes/res/icc.cmodel</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <!-- Enable logging for the model compilation. -->
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.7</version>
            <scope>runtime</scope>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
      <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no
      influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>
                      exec-maven-plugin
                    </artifactId>
                    <versionRange>[1.3,)</versionRange>
                    <goals>
                      <goal>java</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>model/*.model</exclude>
          <exclude>log4j.properties</exclude>
          <exclude>android.jar</exclude>
          <exclude>db/*</exclude>
        </excludes>
        <filtering>false</filtering>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <!-- Use mvn clean compile package -P standalone to generate standalone version with proper
      logging. -->
      <id>standalone</id>
      <dependencies>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
          <version>1.7.7</version>
        </dependency>
      </dependencies>

      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
            <includes>
              <include>log4j.properties</include>
            </includes>
            <filtering>false</filtering>
          </resource>
        </resources>

        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>edu.psu.cse.siis.ic3.Main</mainClass>
                </manifest>
              </archive>
              <descriptors>
                <descriptor>src/assembly/jar.xml</descriptor>
                <descriptor>src/assembly/bin.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <!-- Automatically package everything during install or deploy phases. -->
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.3</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>com.jcraft</groupId>
      <artifactId>jsch</artifactId>
      <version>0.1.51</version>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.31</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.7</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>edu.psu.cse.siis</groupId>
      <artifactId>coal</artifactId>
      <version>0.1.6</version>
    </dependency>
    <dependency>
      <groupId>infoflow</groupId>
      <artifactId>infoflow</artifactId>
      <version>20140129</version>
    </dependency>
    <dependency>
      <groupId>infoflow-android</groupId>
      <artifactId>infoflow-android</artifactId>
      <version>20140213</version>
    </dependency>
  </dependencies>
</project>