<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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.almis.awe</groupId>
    <artifactId>awe-modules</artifactId>
    <version>4.11.11</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  
  <artifactId>awe-tools</artifactId>
  <packaging>jar</packaging>
  <name>AWE Modules - Tools (V${project.version})</name>
  <description>Awe Tools Module</description>

  <dependencies>
    <dependency>
      <groupId>com.almis.awe</groupId>
      <artifactId>awe-controller</artifactId>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
      <groupId>com.almis.awe</groupId>
      <artifactId>awe-builder-spring-boot-starter</artifactId>
    </dependency>
    <!-- Test dependencies -->
    <!-- Junit 5 -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <properties>
    <application.acronym>awe-tools</application.acronym>
    <skip.karma>true</skip.karma>
    <skip.delombok>false</skip.delombok>
    <application.folder>.</application.folder>
    <sonar.testExecutionReportPaths>../../awe-client-angular/target/reports/karma/junit/javascriptUnitTests.xml</sonar.testExecutionReportPaths>
  </properties>

  <build>
    <finalName>awe-tools</finalName>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources/js/awe-tools</directory>
        <targetPath>${project.build.directory}/classes/js/awe-tools</targetPath>
      </resource>
      <resource>
        <directory>${project.basedir}/src/main/resources/templates</directory>
        <targetPath>${project.build.directory}/classes/templates</targetPath>
      </resource>
      <resource>
        <directory>${project.basedir}/src/main/resources/application</directory>
        <targetPath>${project.build.directory}/classes/application</targetPath>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok-maven-plugin</artifactId>
      </plugin>
      <!-- AWE static resources -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>Get web resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <resources>
                <!-- Awe generic screens -->
                <resource>
                  <directory>../awe-generic-screens/src/main/resources</directory>
                  <includes>
                    <include>schemas/**</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Xml validation -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>xml-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>validate</id>
            <phase>compile</phase>
            <goals>
              <goal>validate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Frontend generation -->
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>