<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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>ch.vorburger.mariaDB4j</groupId>
    <artifactId>mariaDB4j-pom</artifactId>
    <version>3.2.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>mariaDB4j-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>

  <name>mariaDB4j-maven-plugin</name>

  <properties>
    <maven.version>3.9.9</maven.version>
    <skipTests>false</skipTests>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>mariaDB4j</artifactId>
    </dependency>

    <dependency>
      <scope>provided</scope>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
    </dependency>
    <dependency>
      <scope>provided</scope>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
    </dependency>
    <dependency>
      <scope>provided</scope>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
    </dependency>

    <dependency>
      <scope>test</scope>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
    </dependency>
    <dependency>
      <scope>test</scope>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-compat</artifactId>
    </dependency>
    <dependency>
      <scope>provided</scope>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
    </dependency>

    <dependency>
      <scope>test</scope>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <scope>test</scope>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>
    <dependency>
      <scope>test</scope>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>
    <dependency>
      <scope>test</scope>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotations</artifactId>
    </dependency>
    <dependency>
      <scope>test</scope>
      <groupId>org.mariadb.jdbc</groupId>
      <artifactId>mariadb-java-client</artifactId>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>mariaDB4j</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-settings</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-settings-builder</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>maven-common-artifact-filters</artifactId>
        <version>3.4.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.15.1</version>
      </dependency>
      <dependency>
        <scope>test</scope>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.27.3</version>
      </dependency>
      <dependency>
        <scope>test</scope>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>5.16.1</version>
      </dependency>
      <dependency>
        <scope>test</scope>
        <groupId>org.apache.maven.plugin-testing</groupId>
        <artifactId>maven-plugin-testing-harness</artifactId>
        <version>3.3.0</version>
      </dependency>
      <dependency>
        <scope>test</scope>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-compat</artifactId>
        <version>3.9.9</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <!-- required by src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml -->
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.15.1</version>
        <configuration>
          <goalPrefix>mariaDB4j</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>default-descriptor</id>
            <phase>process-classes</phase>
          </execution>
          <execution>
            <id>generate-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>generated-helpmojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Include slf4j-api in the plugin jar to ensure some versions of maven don't have
                logging issues.
                     Deprecate when min maven version is 3.3.9+ currently we allow 3.1.1+
                     see https://issues.apache.org/jira/browse/MNG-5787 for details.
                -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>org.slf4j:slf4j-api</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This
                plugin's configuration is used to store Eclipse m2e settings only. It has no
                influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>
                      org.apache.maven.plugins
                    </groupId>
                    <artifactId>
                      maven-plugin-plugin
                    </artifactId>
                    <versionRange>
                      [3.5.2,)
                    </versionRange>
                    <goals>
                      <goal>descriptor</goal>
                      <goal>helpmojo</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <versionRange>[3.2.0,)</versionRange>
                    <goals>
                      <goal>install</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>integration</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <id>prepare-integration-test</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                  <settingsFile>src/it/settings.xml</settingsFile>
                  <postBuildHookScript>verify</postBuildHookScript>
                  <addTestClassPath>true</addTestClassPath>
                  <skipInvocation>${skipTests}</skipInvocation>
                  <streamLogs>true</streamLogs>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>full</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-site</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <id>prepare-integration-test</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                  <settingsFile>src/it/settings.xml</settingsFile>
                  <postBuildHookScript>verify</postBuildHookScript>
                  <addTestClassPath>true</addTestClassPath>
                  <skipInvocation>${skipTests}</skipInvocation>
                  <streamLogs>true</streamLogs>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>3.15.1</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.9.0</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>index</report>
                  <report>cim</report>
                  <report>issue-tracking</report>
                  <report>license</report>
                  <report>scm</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>

</project>
