<?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>neo4j-jdbc-parent</artifactId>
    <groupId>org.neo4j</groupId>
    <version>6.7.3</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>neo4j-jdbc-bundle</artifactId>
  <name>Neo4j JDBC Driver (Bundle)</name>
  <description>Single jar package of the Neo4j JDBC Driver.</description>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-dep-free-module-info</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${maven.multiModuleProjectDirectory}/bin/remove-shaded-dependencies-from-module-info.sh</executable>
              <arguments>
                <argument>${project.basedir}/../../neo4j-jdbc/src/main/java/module-info.java</argument>
                <argument>${project.build.directory}/jpms/module-info.java</argument>
              </arguments>
              <skip>false</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.cyclonedx</groupId>
        <artifactId>cyclonedx-maven-plugin</artifactId>
        <configuration>
          <includeCompileScope>false</includeCompileScope>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.graalvm.buildtools</groupId>
        <artifactId>native-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-reachability-metadata</id>
            <goals>
              <goal>add-reachability-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>io.github.cdimascio:dotenv-java</include>
                  <include>io.netty:*</include>
                  <include>org.neo4j.bolt:*</include>
                  <include>org.neo4j:neo4j-cypher-dsl-schema-name-support</include>
                  <include>org.neo4j:neo4j-jdbc-authn-spi:*</include>
                  <include>org.neo4j:neo4j-jdbc-translator-spi:*</include>
                  <include>org.neo4j:neo4j-jdbc:*</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>io.github.cdimascio.dotenv</pattern>
                  <shadedPattern>org.neo4j.jdbc.internal.shaded.dotenv</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.netty</pattern>
                  <shadedPattern>org.neo4j.jdbc.internal.shaded.io.netty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.neo4j.bolt.connection</pattern>
                  <shadedPattern>org.neo4j.jdbc.internal.shaded.bolt</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.neo4j.cypherdsl.support.schema_name</pattern>
                  <shadedPattern>org.neo4j.jdbc.internal.shaded.schema_name</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
                <transformer />
                <transformer />
              </transformers>
              <filters>
                <filter>
                  <artifact>io.github.cdimascio:*</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>io.netty:*</artifact>
                  <excludes>
                    <exclude>META-INF/native-image/**</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/io.netty.versions.properties</exclude>
                    <exclude>services/reactor.blockhound.integration.BlockHoundIntegration</exclude>
                    <exclude>META-INF/**/module-info.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.neo4j.bolt:*</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.neo4j:neo4j-cypher-dsl-schema-name-support</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.neo4j:neo4j-jdbc-authn-spi</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.neo4j:neo4j-jdbc-translator-spi</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.neo4j:neo4j-jdbc</artifact>
                  <excludes>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>module-info.class</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.moditect</groupId>
        <artifactId>moditect-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-module-infos</id>
            <phase>package</phase>
            <goals>
              <goal>add-module-info</goal>
            </goals>
            <configuration>
              <overwriteExistingFiles>true</overwriteExistingFiles>
              <module>
                <moduleInfoFile>${project.build.directory}/jpms/module-info.java</moduleInfoFile>
              </module>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>attach</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>../../neo4j-jdbc/target/neo4j-jdbc-${project.version}-javadoc.jar</file>
                  <type>jar</type>
                  <classifier>javadoc</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <classpathDependencyExcludes>
                <classpathDependencyExclude>${project.groupId}:neo4j-jdbc</classpathDependencyExclude>
              </classpathDependencyExcludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.27.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.13.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-jdbc-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <properties>
    <sonar.coverage.jacoco.xmlReportPaths>${basedir}/../../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
  </properties>
</project>
