<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.github.lucasgois1.depviz</groupId>
    <artifactId>depviz-parent</artifactId>
    <version>0.1.3</version>
  </parent>

  <artifactId>depviz-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Depviz Maven Plugin</name>

  <dependencies>
    <dependency>
      <groupId>io.github.lucasgois1.depviz</groupId>
      <artifactId>depviz-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${maven.plugin.tools.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-dependency-tree</artifactId>
      <version>${maven.dependency.tree.version}</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <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>
          <detectJavaApiLink>false</detectJavaApiLink>
          <doclint>none</doclint>
          <failOnError>false</failOnError>
          <quiet>true</quiet>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${maven.plugin.tools.version}</version>
        <executions>
          <execution>
            <id>descriptor</id>
            <goals><goal>descriptor</goal></goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals><goal>helpmojo</goal></goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <projectsDirectory>src/it</projectsDirectory>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
          <settingsFile>src/it/settings.xml</settingsFile>
          <postBuildHookScript>verify</postBuildHookScript>
          <goals>
            <goal>io.github.lucasgois1.depviz:depviz-maven-plugin:${project.version}:open</goal>
          </goals>
          <properties>
            <depviz.open>false</depviz.open>
          </properties>
          <filterProperties>
            <depviz.plugin.version>${project.version}</depviz.plugin.version>
          </filterProperties>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals><goal>install</goal><goal>run</goal></goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
