<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>19.0.0.redhat-2</version>
    <relativePath/>
  </parent>

  <groupId>org.bouncycastle</groupId>
  <artifactId>bouncycastle-project</artifactId>
  <version>1.80.0.redhat-00001</version>
  <packaging>pom</packaging>

  <name>Bouncy Castle</name>
  <description>The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms.</description>
  <url>http://www.bouncycastle.org/java.html</url>
  <organization>
    <name>BouncyCastle.org</name>
    <url>http://www.bouncycastle.org</url>
  </organization>
  <licenses>
    <license>
      <name>Bouncy Castle Licence</name>
      <url>http://www.bouncycastle.org/licence.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>feedback-crypto</id>
      <name>The Legion of the Bouncy Castle Inc.</name>
      <email>feedback-crypto@bouncycastle.org</email>
    </developer>
  </developers>

  <modules>
    <module>mail</module>
    <module>jakarta-mail</module>
    <module>pg</module>
    <module>pkix</module>
    <module>prov</module>
    <module>util</module>
  </modules>

  <scm>
    <connection>scm:git:git://github.com/bcgit/bc-java</connection>
    <developerConnection>scm:git:git@github.com:bcgit/bc-java.git</developerConnection>
    <url>https://github.com/bcgit/bc-java</url>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>http://www.bouncycastle.org/jira/secure/Dashboard.jspa</url>
  </issueManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <bc.test.data.home>${basedir}/../core/src/test/data</bc.test.data.home>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.sun.mail</groupId>
        <artifactId>javax.mail</artifactId>
        <version>1.5.3</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2.redhat-00001</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>com.unboundid</groupId>
      <artifactId>unboundid-ldapsdk</artifactId>
      <version>6.0.8</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2.redhat-00001</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
         </plugin>
         <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
          <configuration>
            <systemPropertyVariables>
              <bc.test.data.home>${bc.test.data.home}</bc.test.data.home>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.5.4</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.9.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>regex-property</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>artifactId.short</name>
              <value>\${project.artifactId}</value>
              <regex>.(.*)-jdk18on$</regex>
              <replacement>$1</replacement>
              <failIfNoMatch>false</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <archive>
                <manifest>
                  <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
                  <addDefaultImplementationEntries>false</addDefaultImplementationEntries>
                </manifest>
              </archive>
              <instructions combine.self="append">
                <Bundle-RequiredExecutionEnvironment>J2SE-1.5, JavaSE-1.6, JavaSE-1.7, JavaSE-1.8, JavaSE-1.9</Bundle-RequiredExecutionEnvironment>
                <Extension-Name>org.bouncycastle.${artifactId.short}</Extension-Name>
                <Trusted-Library>true</Trusted-Library>
                <Permissions>all-permissions</Permissions>
                <Codebase>*</Codebase>
                <Application-Library-Allowable-Codebase>*</Application-Library-Allowable-Codebase>
                <Caller-Allowable-Codebase>*</Caller-Allowable-Codebase>
                <Application-Name>${project.name}</Application-Name>
                <Bundle-Name>${artifactId.short}</Bundle-Name>
                <Bundle-SymbolicName>${artifactId.short}</Bundle-SymbolicName>
                <Specification-Title>${project.name}</Specification-Title>
                <Specification-Version>1.1</Specification-Version>
                <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                <Implementation-Title>${project.name}</Implementation-Title>
                <Implementation-Version>${project.version}</Implementation-Version>
                <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                <Implementation-URL>${project.url}</Implementation-URL>
                <_fixupmessages>"Classes found in the wrong directory";is:=warning</_fixupmessages>
              </instructions>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>java11-mr-build</id>
      <activation>
        <jdk>[11,)</jdk>
        <file>
          <exists>${basedir}/src/main/jdk1.11</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>compile-java11</id>
                <phase>compile</phase>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <release>11</release>
                  <buildDirectory>${project.build.directory}</buildDirectory>
                  <compileSourceRoots>${basedir}/src/main/jdk1.11</compileSourceRoots>
                  <outputDirectory>
                    ${project.build.directory}/classes/META-INF/versions/11
                  </outputDirectory>
                  <additionalClasspathElements>
                    <additionalClasspathElement>${project.build.directory}/classes/META-INF/versions/10</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.directory}/classes/META-INF/versions/9</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                  </additionalClasspathElements>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
              <archive>
                <manifestEntries>
                  <Multi-Release>true</Multi-Release>
                </manifestEntries>
              </archive>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>  
</project>
