<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>com.zaxxer</groupId>
   <artifactId>sansorm</artifactId>
   <version>3.7</version>
   <packaging>bundle</packaging>

   <name>SansOrm</name>
   <description>A "No-ORM" sane SQL &lt;-&gt; Java object mapping library</description>
   <url>https://github.com/brettwooldridge/SansOrm</url>

   <organization>
      <name>Brett Wooldridge</name>
      <url>https://github.com/brettwooldridge</url>
   </organization>

   <scm>
      <connection>scm:git:git@github.com:brettwooldridge/SansOrm.git</connection>
      <developerConnection>scm:git:git@github.com:brettwooldridge/SansOrm.git</developerConnection>
      <url>git@github.com:brettwooldridge/SansOrm.git</url>
   </scm>

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

   <developers>
      <developer>
         <name>Brett Wooldridge</name>
         <email>brett.wooldridge@gmail.com</email>
      </developer>
      <developer>
         <name>Leo Bayer</name>
         <email>lfbayer@gmail.com</email>
      </developer>
   </developers>

   <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <sureFireOptions9 />
      <sureFireForks9>false</sureFireForks9>
   </properties>

   <parent>
      <groupId>org.sonatype.oss</groupId>
      <artifactId>oss-parent</artifactId>
      <version>7</version>
   </parent>

   <dependencies>
      <dependency>
         <groupId>org.eclipse.persistence</groupId>
         <artifactId>javax.persistence</artifactId>
         <version>2.1.0</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>javax.transaction</groupId>
         <artifactId>transaction-api</artifactId>
         <version>1.1</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>1.7.25</version>
         <scope>provided</scope>
      </dependency>
      <dependency>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <version>2.3.7</version>
         <type>maven-plugin</type>
         <scope>provided</scope>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>javax.transaction</groupId>
         <artifactId>javax.transaction-api</artifactId>
         <version>1.2</version>
         <scope>compile</scope>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.12</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <version>1.4.191</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.zaxxer</groupId>
         <artifactId>HikariCP</artifactId>
         <version>2.7.2</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
         <version>3.8.0</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
         <version>1.7.25</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.postgresql</groupId>
         <artifactId>postgresql</artifactId>
         <version>9.4-1206-jdbc42</version>
         <scope>provided</scope>
         <optional>true</optional>
      </dependency>
      <dependency>
         <groupId>org.xerial</groupId>
         <artifactId>sqlite-jdbc</artifactId>
         <version>3.20.1</version>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.9</version>
            <executions>
               <!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when Maven the Surefire plugin is executed. -->
               <execution>
                  <goals>
                     <goal>prepare-agent</goal>
                  </goals>
                  <configuration>
                     <!-- Sets the path to the file which contains the execution data. -->
                     <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
                     <!-- Sets the name of the property containing the settings for JaCoCo runtime agent. -->
                     <propertyName>surefireArgLine</propertyName>
                  </configuration>
               </execution>
               <!-- Ensures that the code coverage report for unit tests is created after unit tests have been run. -->
               <execution>
                  <id>report</id>
                  <phase>test</phase>
                  <goals>
                     <goal>report</goal>
                  </goals>
                  <configuration>
                     <!-- Sets the path to the file which contains the execution data. -->
                     <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
                  </configuration>
               </execution>
            </executions>
         </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20</version>
            <configuration>
               <!-- Sets the VM argument line used when unit tests are run. -->
               <argLine>${surefireArgLine} ${sureFireOptions9}</argLine>
               <!-- Skips unit tests if the value of skip.unit.tests property is true -->
               <skipTests>${skip.unit.tests}</skipTests>
               <reuseForks>${sureFireForks9}</reuseForks>
            </configuration>
         </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
               <source>1.8</source>
               <target>1.8</target>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.5.0</version>
            <extensions>true</extensions>
            <configuration>
               <instructions>
                  <Export-Package>com.zaxxer.sansorm,com.zaxxer.sansorm.transaction</Export-Package>
                  <Import-Package>org.slf4j,javax.persistence,javax.sql,javax.transaction;resolution:=optional,org.postgresql.util;resolution:=optional</Import-Package>
                  <Private-Package>com.zaxxer.sansorm.internal</Private-Package>
                  <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
               </instructions>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
            <configuration>
               <!-- outputDirectory>/absolute/path/to/the/output/directory</outputDirectory>
                  <finalName>filename-of-generated-jar-file</finalName -->
               <attach>true</attach>
            </configuration>
            <executions>
               <execution>
                  <id>attach-sources</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.3</version>
            <configuration>
               <show>public</show>
               <excludePackageNames>com.zaxxer.sansorm.*</excludePackageNames>
               <attach>true</attach>
               <maxmemory>1024m</maxmemory>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>release-sign-artifacts</id>
         <activation>
            <property>
               <name>performRelease</name>
               <value>true</value>
            </property>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>1.4</version>
                  <executions>
                     <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                           <goal>sign</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
</project>

