<?xml version="1.0"?>
<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>org.beigesoft</groupId>
  <version>1.1.4</version>
  <artifactId>beigesoft-accountingoio-android</artifactId>
  <packaging>apk</packaging>
  <name>Beigesoft ™ Accountion All In One on embedded A-Jetty for Android</name>
  
  <description>This is Android version of Beige-Accounting plus Beige-WebStore on embedded A-Jetty.
    Web-Store is included for study and tests purposes and you are also able to make full DB copy from cloud version.
    Web-Store is draft yet.</description>
  <url>http://www.beigesoft.org</url>
  <inceptionYear>2017</inceptionYear>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.7</java.version>
  </properties>

  <profiles>
    <profile>
      <id>signApk</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>signing</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>package</phase>
                <inherited>true</inherited>
                <configuration>
                  <archiveDirectory />
                  <includes>
                    <include>target/*.apk</include>
                  </includes>
                  <storepass>${signpass}</storepass>
                  <keypass>${signpass}</keypass>
                  <alias>bsf-key</alias>
                  <arguments>
                    <argument>-sigalg</argument><argument>MD5withRSA</argument>
                    <argument>-digestalg</argument><argument>SHA1</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.simpligility.maven.plugins</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>4.5.0</version>
            <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}-sa.apk</outputApk>
                <skip>false</skip>  
              </zipalign>
            </configuration>
            <executions>
              <execution>
                <id>alignApk</id>
                <phase>package</phase>
                <goals>
                  <goal>zipalign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>signing</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>package</phase>
                <inherited>true</inherited>
                <configuration>
                  <archiveDirectory />
                  <includes>
                    <include>target/*.apk</include>
                  </includes>
                  <storepass>${signpass}</storepass>
                  <keypass>${signpass}</keypass>
                  <alias>bsf-key</alias>
                  <arguments>
                    <argument>-sigalg</argument><argument>MD5withRSA</argument>
                    <argument>-digestalg</argument><argument>SHA1</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.simpligility.maven.plugins</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <version>4.5.0</version>
            <inherited>true</inherited>
            <configuration>
              <sign>
                <debug>false</debug>
              </sign>
            </configuration>
          </plugin>
          <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.10.2</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>48E407CA</keyname>
                  <passphraseServerId>48E407CA</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>check</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.17</version>
            <executions>
              <execution>
              <id>checkstyle</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
              </execution>
            </executions>
            <configuration>
              <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
              <excludes>**/R.java,**/BuildConfig.java,**/androidtest/**,**/apache/**,**/eclipse/**</excludes>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.3</version>
            <configuration>
              <excludeFilterFile>findbug-exclude.xml</excludeFilterFile>
            </configuration>
            <executions>
              <execution>
              <id>findbugs</id>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.6</version>
            <configuration>
              <printFailingErrors>true</printFailingErrors>
              <excludes>
                <exclude>**/apache/**</exclude>
                <exclude>**/eclipse/**</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
              <id>pmd</id>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
    
  <dependencies>
    <dependency>
      <groupId>org.beigesoft</groupId>
      <artifactId>beigesoft-android-sqlite</artifactId>
      <version>1.1.4</version>
    </dependency>
    <dependency>
      <groupId>org.beigesoft</groupId>
      <artifactId>beigesoft-accountingoio-ajetty</artifactId>
      <version>1.1.4</version>
      <exclusions>
        <exclusion>
          <groupId>org.xerial</groupId>
          <artifactId>sqlite-jdbc</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.zaxxer</groupId>
          <artifactId>HikariCP</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.github.demidenko05</groupId>
          <artifactId>a-jetty-swing</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.beigesoft</groupId>
          <artifactId>beige-jdbc</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.mail</groupId>
          <artifactId>javax.mail</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.github.demidenko05</groupId>
      <artifactId>a-jetty-base</artifactId>
      <version>1.0.2</version>
    </dependency>
    <dependency>
        <groupId>com.sun.mail</groupId>
        <artifactId>android-mail</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>com.sun.mail</groupId>
        <artifactId>android-activation</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
      <version>4.1.1.4</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <resources>
      <!--Android Maven plugin will chooses these resources ordered by Maven Resource plugin
        and removes other duplicates from jars:-->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${user.home}/git/beigesoft-accounting-weboio-jar/src/main/resources</directory>
      </resource>
      <resource>
        <directory>${user.home}/git/beigesoft-webstore/src/main/resources</directory>
      </resource>
      <resource>
        <directory>${user.home}/git/beigesoft-accounting/src/main/resources</directory>
      </resource>
      <resource>
        <directory>${user.home}/git/beigesoft-webcrud-jar/src/main/resources</directory>
      </resource>
      <resource>
        <directory>${user.home}/git/beigesoft-orm/src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>com.simpligility.maven.plugins</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <version>4.5.0</version>
        <configuration>
          <sdk>
            <platform>24</platform>
          </sdk>
          <undeployBeforeDeploy>true</undeployBeforeDeploy>
          <extractDuplicates>true</extractDuplicates>
          <lint>
            <skip>false</skip>
            <classpath>${project.build.outputDirectory}</classpath>
          </lint>
        </configuration>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.7</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <useFile>false</useFile>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <compilerArgs>
            <!--<arg>-verbose</arg>-->
            <arg>-Xlint:all,-options,-path</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.0.0</version>
        <inherited>false</inherited>
        <configuration>
          <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
          <descriptors>
            <descriptor>assembly.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <developers>
    <developer><name>Yury Demidenko</name></developer>
  </developers>

  <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>

  <licenses>
    <license>
      <name>GNU General Public License version 2</name>
      <url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>The Eclipse Public License, Version 1.0</name>
      <url>http://www.eclipse.org/legal/epl-v10.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>Common Development and Distribution License (CDDL) v1.0</name>
      <url>https://glassfish.dev.java.net/public/CDDLv1.0.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>DejaVu fonts License</name>
      <url>https://dejavu-fonts.github.io/License.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <scm>
    <url>https://github.com/demidenko05/beigesoft-accountingoio-android.git</url>
    <connection>scm:git:git@github.com:demidenko05/beigesoft-accountingoio-android.git</connection>
    <developerConnection>scm:git:git@github.com:demidenko05/beigesoft-accountingoio-android.git</developerConnection>
    <tag>beigesoft-accountingoio-android-1.1.4</tag>
  </scm>

</project>
