<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>

    <!-- artifact identification -->
    <groupId>com.acciente.oacc</groupId>
    <artifactId>acciente-oacc</artifactId>
    <version>2.0.0</version>
    <packaging>jar</packaging>

    <properties>
        <!-- Dependency versions -->
        <bcprov-jdk15on.version>1.58</bcprov-jdk15on.version>
        <jasypt.version>1.9.2</jasypt.version>
        <junit.version>4.12</junit.version>
        <hamcrest-all.version>1.3</hamcrest-all.version>
        <icu4j.version>59.1</icu4j.version>
        <postgresql.version>42.1.1.jre7</postgresql.version>

        <!-- Maven plugin versions -->
        <maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-surefire-plugin.version>2.20</maven-surefire-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <tools-maven-plugin.version>1.4</tools-maven-plugin.version>

        <!-- Don't compile tests automatically since they assume a test db is already setup -->
        <maven.test.skip>true</maven.test.skip>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- project information -->
    <name>Acciente OACC</name>
    <description>OACC is a Java Application Security Framework. OACC provides a high-performance access control
        system for Java applications. OACC provides fine grained permissions based access control for application
        objects. It has support for hierarchical domains, super users, permission inheritance and impersonation.
    </description>

    <!-- dependencies -->
    <dependencies>
        <!-- compile time scope: -->
        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
            <version>${icu4j.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>${bcprov-jdk15on.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jasypt</groupId>
            <artifactId>jasypt</artifactId>
            <version>${jasypt.version}</version>
            <scope>compile</scope>
        </dependency>
        <!-- test scope: -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest-all.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgresql.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- shared project information -->
    <url>http://www.oaccframework.org</url>
    <inceptionYear>2014</inceptionYear>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>Commercial-friendly, open-source license</comments>
        </license>
    </licenses>
    <organization>
        <name>Acciente, LLC</name>
        <url>http://www.acciente.com</url>
    </organization>
    <developers>
        <developer>
            <id>adinath</id>
            <name>Adinath Raveendra Raj</name>
            <organization>Acciente, LLC</organization>
            <organizationUrl>http://www.acciente.com</organizationUrl>
            <timezone>-7</timezone>
        </developer>
        <developer>
            <id>fabian</id>
            <name>Fabian Spinnenhirn</name>
            <organization>Acciente, LLC</organization>
            <organizationUrl>http://www.acciente.com</organizationUrl>
            <timezone>-7</timezone>
        </developer>
    </developers>

    <!-- profile to build for jdk1.7 -->
    <profiles>
        <profile>
            <id>jdk1_7</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <!-- export a property with the JDK version for use in the build section -->
            <properties>
                <jdk-version>jdk1_7</jdk-version>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <!-- compiler settings -->
                        <configuration>
                            <source>1.7</source>
                            <target>1.7</target>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk1_7_release</id>
            <!-- export a property with the JDK version for use in the build section -->
            <properties>
                <jdk-version>jdk1_7</jdk-version>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven-compiler-plugin.version}</version>
                        <!-- compiler settings -->
                        <configuration>
                            <source>1.7</source>
                            <target>1.7</target>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</version>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                        <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>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- shared build settings -->
    <build>
        <outputDirectory>target/classes-${jdk-version}</outputDirectory>
        <testOutputDirectory>target/test-classes-${jdk-version}</testOutputDirectory>
        <!-- we want the jar with the classes to have the JDK suffix -->
        <finalName>${project.artifactId}-${project.version}-${jdk-version}</finalName>
        <plugins>
            <!-- configure the maven source plugin to make a source jar in the package phase -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <configuration>
                    <!-- we want the jar with the sources to NOT have the JDK suffix -->
                    <finalName>${project.artifactId}-${project.version}</finalName>
                </configuration>
            </plugin>
            <!-- configure the javadoc plugin to make a javadoc jar in the package phase -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <!-- we want the jar with the javadocs to NOT have the JDK suffix -->
                    <finalName>${project.artifactId}-${project.version}</finalName>
                    <outputDirectory>target/apidocs-${project.version}</outputDirectory>
                    <doctitle>${project.name} ${project.version} API</doctitle>
                    <bottom><![CDATA[<br><a href="http://www.oaccframework.org">OACC<a> is a Java Application Security Framework developed by <a href="http://www.acciente.com">Acciente, LLC.<a>, released under <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.<br>Copyright 2009-2018, <a href="http://www.acciente.com">Acciente, LLC.<a>]]></bottom>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.geronimo.genesis.plugins</groupId>
                <artifactId>tools-maven-plugin</artifactId>
                <version>${tools-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>install-legal-files</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-legal-files</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>false</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- shared reporting settings -->
    <reporting>
        <plugins>
            <!-- javadoc plugin settings -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <header>
                        <![CDATA[<a href="http://www.oaccframework.org" target="_top">Return to www.oaccframework.org</a>]]>
                    </header>
                </configuration>
            </plugin>
        </plugins>
    </reporting>


    <!-- SCM settings -->
    <scm>
        <connection>https://github.com/acciente/oacc-core.git</connection>
        <developerConnection>https://github.com/acciente/oacc-core.git</developerConnection>
        <tag>master</tag>
        <url>https://github.com/acciente/oacc-core</url>
    </scm>

    <!-- distribution settings -->
    <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>

</project>
