<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>

  <!-- The Basics -->
  <groupId>net.pincette</groupId>
  <artifactId>jslt</artifactId>
  <version>0.1.14</version>
  <packaging>jar</packaging>
  <name>jslt</name>
  <description>JSLT as a module</description>
  <url>https://github.com/wdonne/jslt</url>

  <scm>
    <url>https://github.com/wdonne/jslt</url>
    <connection>scm:git@github.com:wdonne/jslt.git</connection>
    <developerConnection>scm:git@github.com:wdonne/jslt.git</developerConnection>
  </scm>

  <developers>
    <developer>
      <id>wdonne</id>
      <name>Werner Donné</name>
      <email>werner.donne@pincette.net</email>
      <url>https://pincette.net</url>
      <organization>Pincette</organization>
      <organizationUrl>https://pincette.net</organizationUrl>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>Apache-2.0style</name>
      <url>https://opensource.org/licenses/Apache-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <maven.compiler.target>9</maven.compiler.target>
    <maven.compiler.source>9</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.14.1</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>2.14.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.1</version>
        <configuration>
          <additionalJOptions>
            <additionalJOption>-J-Dhttp.agent=maven-javadoc-plugin-${project.name}
            </additionalJOption>
          </additionalJOptions>
          <links>
            <link>http://docs.oracle.com/javase/8/docs/api/</link>
          </links>
          <sourceFileExcludes>
            <sourceFileExclude>**/module-info.java</sourceFileExclude>
            <sourceFileExclude>**/parser/**</sourceFileExclude>
          </sourceFileExcludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>jjtree</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-cp</argument>
                <argument>${project.basedir}/javacc.jar</argument>
                <argument>jjtree</argument>
                <argument>
                  -OUTPUT_DIRECTORY=${project.build.directory}/generated-sources/com/schibsted/spt/data/jslt/parser
                </argument>
                <argument>${project.basedir}/src/main/jjtree/jslt.jjt</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>javacc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-cp</argument>
                <argument>${project.basedir}/javacc.jar</argument>
                <argument>javacc</argument>
                <argument>
                  -OUTPUT_DIRECTORY=${project.build.directory}/generated-sources/com/schibsted/spt/data/jslt/parser
                </argument>
                <argument>
                  ${project.build.directory}/generated-sources/com/schibsted/spt/data/jslt/parser/jslt.jj
                </argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <executions>
          <execution>
            <id>default-compile</id>
            <configuration>
              <!-- compile everything to ensure module-info contains right entries -->
              <!-- required when JAVA_HOME is JDK 8 or below -->
              <jdkToolchain>
                <version>9</version>
              </jdkToolchain>
              <release>9</release>
            </configuration>
          </execution>
          <execution>
            <id>base-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <!-- recompile everything for target VM except the module-info.java -->
            <configuration>
              <excludes>
                <exclude>module-info.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
        <!-- defaults for compile and testCompile -->
        <configuration>
          <!-- jdkToolchain required when JAVA_HOME is JDK 9 or above -->
          <jdkToolchain>
            <version>[1.8,9)</version>
          </jdkToolchain>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.4.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>com.schibsted.spt.data.jslt.cli.JSLT</mainClass>
                </manifest>
              </archive>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
        <configuration>
          <forkCount>0</forkCount>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
    </plugins>
  </build>
</project>
