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

  <modelVersion>4.0.0</modelVersion>
  <artifactId>baremaps-editor</artifactId>
  <name>baremaps-editor</name>

  <parent>
    <artifactId>baremaps</artifactId>
    <groupId>com.baremaps</groupId>
    <version>0.5.4</version>
  </parent>

  <build>
    <plugins>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.10.0</version>
        <configuration>
          <workingDirectory>editor</workingDirectory>
        </configuration>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeVersion>v14.16.1</nodeVersion>
              <npmVersion>6.14.12</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm run build</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>run build</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/classes/maputnik</outputDirectory>
              <resources>
                <resource>
                  <directory>editor/build/build</directory>
                  <excludes>
                    <exclude>bundle-stats.html</exclude>
                    <exclude>bundle-stats.json</exclude>
                  </excludes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>com.baremaps</groupId>
      <artifactId>baremaps-config</artifactId>
    </dependency>
    <dependency>
      <groupId>com.baremaps</groupId>
      <artifactId>baremaps-tile</artifactId>
    </dependency>
    <dependency>
      <groupId>com.baremaps</groupId>
      <artifactId>baremaps-tile-postgres</artifactId>
    </dependency>
    <dependency>
      <groupId>com.linecorp.armeria</groupId>
      <artifactId>armeria</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
    </dependency>
  </dependencies>

</project>