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

  <groupId>org.opendaylight.plastic</groupId>
  <artifactId>odl-plastic</artifactId>
  <version>2.1.7</version>
  <packaging>jar</packaging>

  <name>odl-plastic</name>
  <description>app for mapping xml/json to arbitrary xml/json</description>

    <!-- Below copied from odl-parent, which we do not inherit from -->

    <!-- Sufficient Metadata for Maven Central Repository deployment
          These are default, some of which project inheriting from this POM may override (but don't have to, typically)
          see http://central.sonatype.org/pages/requirements.html
      -->
    <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>

    <licenses>
        <license>
            <name>Eclipse Public License v1.0</name>
            <url>https://www.eclipse.org/legal/epl-v10.html</url>
        </license>
    </licenses>

    <organization>
        <name>OpenDaylight</name>
        <url>https://www.opendaylight.org</url>
    </organization>

    <issueManagement>
        <system>JIRA</system>
        <url>https://jira.opendaylight.org/</url>
    </issueManagement>

    <ciManagement>
        <system>Jenkins</system>
        <url>https://jenkins.opendaylight.org/releng/</url>
    </ciManagement>

    <scm>
        <url>https://git.opendaylight.org/gerrit/</url>
    </scm>

    <developers>
        <developer>
            <id>*</id>
            <name>Please consult the PROJECT_INFO.yaml, README* and/or CONTRIBUTORS which should be included with this JAR</name>
            <url>https://www.opendaylight.org</url>
            <email>helpdesk@opendaylight.org</email>
        </developer>
    </developers>

  <properties>

      <!-- Below copied from odl-parent, which we do not inherit from -->
      <nexusproxy>https://nexus.opendaylight.org/content</nexusproxy>

      <!-- Variables required for Maven Site generation -->
      <odl.site.url>https://nexus.opendaylight.org/content/sites/site/</odl.site.url>
      <stream>latest</stream><!-- CI should pass in -Dstream={stream} -->

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <groovy.version>2.4.8</groovy.version>
    <spock.version>1.2-groovy-2.4</spock.version>
    <objenesis.version>2.5.1</objenesis.version>
    <surefire.version>2.18.1</surefire.version>
    <guava.version>24.0-jre</guava.version>
    <slf4j.version>1.7.25</slf4j.version>
    <logback.version>1.2.3</logback.version>
    <plastic.runner.dir>plasticrunner</plastic.runner.dir>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>

    <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib-nodep</artifactId>
      <version>3.2.5</version>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.gpars</groupId>
      <artifactId>gpars</artifactId>
      <version>1.2.1</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>${groovy.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <!-- enables mocking of classes without default constructor (together with CGLIB) -->
      <groupId>org.objenesis</groupId>
      <artifactId>objenesis</artifactId>
      <version>${objenesis.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.spockframework</groupId>
      <artifactId>spock-core</artifactId>
      <version>${spock.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <version>1.19</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-generator-annprocess</artifactId>
      <version>1.19</version>
      <scope>test</scope>
    </dependency>

      <!-- Future use of Kotlin for implementation
      <kotlin.version>1.2.71</kotlin.version>
      <dependency>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-stdlib-jdk8</artifactId>
          <version>${kotlin.version}</version>
      </dependency>
      <dependency>
          <groupId>org.jetbrains.kotlin</groupId>
          <artifactId>kotlin-test</artifactId>
          <version>${kotlin.version}</version>
          <scope>test</scope>
      </dependency>
      -->

      <dependency>
          <groupId>com.beust</groupId>
          <artifactId>klaxon</artifactId>
          <version>3.0.4</version>
      </dependency>
      <dependency>
          <groupId>com.google.code.gson</groupId>
          <artifactId>gson</artifactId>
          <version>2.8.4</version>
      </dependency>
  </dependencies>

  <build>
      <testSourceDirectory>src/test/groovy</testSourceDirectory>
      <resources>
      <resource>
        <directory>schemas</directory>
        <includes>
          <include>**/*.*</include>
        </includes>
        <excludes>
          <exclude>**/test/*.*</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>morphers</directory>
        <includes>
          <include>**/*.groovy</include>
        </includes>
        <excludes>
          <exclude>**/test/*.*</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>classifiers</directory>
        <includes>
          <include>**/*.groovy</include>
        </includes>
        <excludes>
          <exclude>**/test/*.*</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>lib</directory>
        <includes>
          <include>**/*.groovy</include>
        </includes>
        <excludes>
          <exclude>**/test/*.*</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M3</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[1.8,1.9)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <!-- 2.8.0-01 and later require maven-compiler-plugin 3.1 or higher -->
        <version>3.1</version>
        <executions>
            <execution>
                <id>compile</id>
                <phase>compile</phase>
                <goals>
                    <goal>compile</goal>
                </goals>
            </execution>
            <execution>
                <id>testCompile</id>
                <phase>test-compile</phase>
                <goals>
                    <goal>testCompile</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
          <compilerId>groovy-eclipse-compiler</compilerId>
        </configuration>
        <dependencies>
          <!-- for 2.8.0-01 and later you must have an explicit dependency on
                        groovy-eclipse-batch -->
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.4.3-01</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.1-01</version>
          </dependency>
        </dependencies>
      </plugin>
      <!-- Only required if names of spec classes don't match default Surefire patterns (`*Test` etc.) -->
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire.version}</version>
        <configuration>
          <useFile>false</useFile>
          <includes>
            <include>**/*Spec.java</include>
            <include>**/*Test.java</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>test-groovy</id>
            <goals>
              <goal>addSources</goal>
              <goal>addTestSources</goal>
              <goal>compileTests</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <execution>
            <id>build-jar-with-dependencies</id>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>org.opendaylight.plastic.implementation.PlasticRunner</mainClass>
                </manifest>
              </archive>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
              <finalName>${project.artifactId}-${project.version}-runner</finalName>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
          <execution>
            <id>package-runner</id>
            <configuration>
              <descriptors>
                <descriptor>src/assembly/plastic_runner.xml</descriptor>
              </descriptors>
              <finalName>${plastic.runner.dir}</finalName>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
          </execution>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <archive>
                  <manifest>
                    <mainClass>org.openjdk.jmh.Main</mainClass>
                  </manifest>
              </archive>
              <descriptors>
                <descriptor>src/assembly/fat_tests.xml</descriptor>
              </descriptors>
              <attach>false</attach>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.17</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

        <!-- Future use of Kotlin for implementation
          <plugin>
              <groupId>org.jetbrains.kotlin</groupId>
              <artifactId>kotlin-maven-plugin</artifactId>
              <version>${kotlin.version}</version>
              <executions>
                  <execution>
                      <id>compile</id>
                      <phase>compile</phase>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                      <configuration>
                          <sourceDirs>
                              <source>src/main/groovy</source>
                              <source>src/main/java</source>
                              <source>src/main/kotlin</source>
                          </sourceDirs>
                      </configuration>
                  </execution>
                  <execution>
                      <id>test-compile</id>
                      <phase>test-compile</phase>
                      <goals>
                          <goal>test-compile</goal>
                      </goals>
                  </execution>
              </executions>
              <configuration>
                  <jvmTarget>1.8</jvmTarget>
              </configuration>
          </plugin>
          -->
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>verify</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
              <configuration>
                <useDefaultExcludes>false</useDefaultExcludes>
                <includes>
                  <include>**/*</include>
                </includes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <!--
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-shade-plugin</artifactId>
              <version>3.2.0</version>
              <executions>
                  <execution>
                      <phase>package</phase>
                      <goals>
                          <goal>shade</goal>
                      </goals>
                      <configuration>
                          <shadeTestJar>true</shadeTestJar>
                          <finalName>benchmarks</finalName>
                          <transformers>
                              <transformer
                                      implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                  <mainClass>org.openjdk.jmh.Main</mainClass>
                              </transformer>
                          </transformers>
                      </configuration>
                  </execution>
              </executions>
          </plugin>
          -->
        <!--
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
                <execution>
                    <configuration>
                        <classifier>benchmark</classifier>
                    </configuration>
                    <phase>package</phase>
                    <goals>
                        <goal>test-jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        -->
      </plugins>
    </build>

      <distributionManagement>
          <repository>
              <id>opendaylight-release</id>
              <url>${nexusproxy}/repositories/opendaylight.release/</url>
          </repository>
          <snapshotRepository>
              <id>opendaylight-snapshot</id>
              <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
          </snapshotRepository>
      </distributionManagement>

  </project>
