<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>pgjdbc-core-parent</artifactId>
    <groupId>org.postgresql</groupId>
    <version>1.1.6</version>
    <relativePath>pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.kaiwudb</groupId>
  <artifactId>kaiwudb-jdbc</artifactId>
  <packaging>bundle</packaging>
  <name>kaiwudb-jdbc</name>
  <version>2.2.0</version>
  <description>Java JDBC 4.2 (JRE 8+) driver for KaiwuDB database.</description>
  <url>https://devops.inspur.com/ISG__ZDP/kw-third_party</url>
  <developers>
    <developer>
      <name>Jaly</name>
      <email>liujiali@inspur.com</email>
      <organization>KaiwuDB Global Development Group</organization>
      <organizationUrl>https://www.kaiwudb.com/</organizationUrl>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>The KaiwuDB License</name>
      <url>https://www.kaiwudb.com/ask/view_191_68.html</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:https://devops.inspur.com/ISG__ZDP/kw-third_party.git</connection>
    <developerConnection>scm:git:ssh://git@devops.inspur.com:30004/ISG__ZDP/kw-third_party.git</developerConnection>
    <url>https://devops.inspur.com/ISG/ZDP/gitee/ISG__ZDP/kw-third_party/tree/master/kwjdbc-aggregate</url>
  </scm>
  <organization>
    <name>KaiwuDB Global Development Group</name>
    <url>https://www.kaiwudb.com/</url>
  </organization>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <finalName>kaiwudb-jdbc-${project.version}</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.5.0</version>
          <configuration>
            <failOnWarnings>true</failOnWarnings>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <configuration>
          <chmod>true</chmod>
          <inputEncoding>UTF-8</inputEncoding>
          <outputEncoding>UTF-8</outputEncoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>com.kaiwudb.jdbc</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer>
                  <mainClass>com.kaiwudb.util.KWJDBCMain</mainClass>
                </transformer>
              </transformers>
              <relocations>
                <relocation>
                  <pattern>com.ongres</pattern>
                  <shadedPattern>com.kaiwudb.shaded.com.ongres</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <filters>
            <filter>
              <artifact>com.ongres.scram:client</artifact>
              <includes>
                <include>**</include>
              </includes>
            </filter>
            <filter>
              <artifact>com.github.ben-manes.caffeine:caffeine</artifact>
              <excludes>
                <exclude>**</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>com.github.waffle:waffle-jna</artifact>
              <excludes>
                <exclude>**</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>org.slf4j:jcl-over-slf4j</artifact>
              <excludes>
                <exclude>**</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>com/sun/jna/**</exclude>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>karaf-maven-plugin</artifactId>
        <version>4.2.5</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>generate-features-file</id>
            <phase>package</phase>
            <goals>
              <goal>features-generate-descriptor</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <startLevel>80</startLevel>
          <includeTransitiveDependency>false</includeTransitiveDependency>
          <aggregateFeatures>false</aggregateFeatures>
          <includeProjectArtifact>true</includeProjectArtifact>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>com.kaiwudb*;</Export-Package>
            <Import-Package>javax.sql, javax.transaction.xa, javax.naming, javax.security.sasl;resolution:=optional,
              *;resolution:=optional</Import-Package>
            <Bundle-Activator>com.kaiwudb.osgi.KWBundleActivator</Bundle-Activator>
            <Bundle-SymbolicName>com.kaiwudb.jdbc${jdbc.specification.version.nodot}</Bundle-SymbolicName>
            <Bundle-Name>KaiwuDB JDBC Driver JDBC${jdbc.specification.version.nodot}</Bundle-Name>
            <Bundle-Copyright>Copyright (c) 2022-present, Shanghai Yunxi Technology Co, Ltd. All rights reserved.</Bundle-Copyright>
            <Require-Capability>osgi.ee;filter:="(&amp;(|(osgi.ee=J2SE)(osgi.ee=JavaSE))(version&gt;=${javac.target}))"</Require-Capability>
            <Provide-Capability>osgi.service;effective:=active;objectClass=org.osgi.service.jdbc.DataSourceFactory</Provide-Capability>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.5.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>translate</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.vlsi.gettext</groupId>
            <artifactId>gettext-maven-plugin</artifactId>
            <version>1.4.0</version>
            <executions>
              <execution>
                <id>update_po_with_new_messages</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>gettext</goal>
                </goals>
              </execution>
              <execution>
                <id>remove_obsolete_translations</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>attrib</goal>
                </goals>
                <configuration>
                  <extraArgs>
                    <extraArg>--no-obsolete</extraArg>
                  </extraArgs>
                </configuration>
              </execution>
              <execution>
                <id>generate_pot_and_po_files</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>merge</goal>
                </goals>
              </execution>
              <execution>
                <id>generate_resource_bundles</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>dist</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <outputFormat>java</outputFormat>
              <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
              <outputDirectory>${project.build.sourceDirectory}</outputDirectory>
              <keysFile>messages.pot</keysFile>
              <poDirectory>src/main/java/com/kaiwudb/translation</poDirectory>
              <targetBundle>com.kaiwudb.translation.messages</targetBundle>
              <keywords>-kGT.tr</keywords>
              <msgmergeCmd>msgmerge</msgmergeCmd>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>excludeWaffleFiles</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>com/kaiwudb/sspi/NTDSAPI.java</exclude>
                <exclude>com/kaiwudb/sspi/NTDSAPIWrapper.java</exclude>
                <exclude>com/kaiwudb/sspi/SSPIClient.java</exclude>
              </excludes>
              <testExcludes>
                <exclude>com/kaiwudb/test/sspi/*.java</exclude>
              </testExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>excludeOsgiFiles</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>com/kaiwudb/osgi/KWBundleActivator.java</exclude>
                <exclude>com/kaiwudb/osgi/KWDataSourceFactory.java</exclude>
              </excludes>
              <testExcludes>
                <exclude>**/KWDataSourceFactoryTest.java</exclude>
                <exclude>**/OsgiTestSuite.java</exclude>
              </testExcludes>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/OsgiTestSuite.java</exclude>
                <exclude>**/KWDataSourceFactoryTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jdk9-workarounds</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-source-plugin</artifactId>
              <dependencies>
                <dependency>
                  <groupId>org.codehaus.plexus</groupId>
                  <artifactId>plexus-archiver</artifactId>
                  <version>4.10.0</version>
                </dependency>
              </dependencies>
            </plugin>
            <plugin>
              <artifactId>maven-jar-plugin</artifactId>
              <dependencies>
                <dependency>
                  <groupId>org.codehaus.plexus</groupId>
                  <artifactId>plexus-archiver</artifactId>
                  <version>4.10.0</version>
                </dependency>
              </dependencies>
            </plugin>
            <plugin>
              <artifactId>maven-assembly-plugin</artifactId>
              <version>2.4.1</version>
              <dependencies>
                <dependency>
                  <groupId>org.codehaus.plexus</groupId>
                  <artifactId>plexus-archiver</artifactId>
                  <version>4.10.0</version>
                </dependency>
              </dependencies>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>se.jiderhamn</groupId>
      <artifactId>classloader-leak-test-framework</artifactId>
      <version>1.1.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>bcel</artifactId>
          <groupId>org.apache.bcel</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.enterprise</artifactId>
      <version>4.2.0</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <version>4.3.1</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <properties>
    <build.properties.relative.path>${basedir}/..</build.properties.relative.path>
    <jdbc.specification.version>4.2</jdbc.specification.version>
    <kaiwudb.enforce.jdk.version>1.8</kaiwudb.enforce.jdk.version>
    <kaiwudb.jdbc.spec>JDBC${jdbc.specification.version}</kaiwudb.jdbc.spec>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <skip.assembly>false</skip.assembly>
    <jdbc.specification.version.nodot>42</jdbc.specification.version.nodot>
    <javac.target>1.8</javac.target>
  </properties>
</project>

