<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.github.steve-community</groupId>
  <artifactId>ocpp-jaxb</artifactId>
  <version>0.0.8</version>
  <organization>
    <name>SteVe Community Team</name>
    <url>https://github.com/steve-community/steve</url>
  </organization>
  <licenses>
    <license>
      <name>GNU General Public License (GPL)</name>
      <url>http://www.gnu.org/licenses/gpl.html</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Sevket Goekay</name>
      <email>sevketgokay@gmail.com</email>
      <url>https://github.com/goekay</url>
    </developer>
  </developers>
  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <lombok.version>1.18.22</lombok.version>
    <cxf.version>3.2.4</cxf.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.10.14</version>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.13.4.2</version>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>2.0.1.Final</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.10.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.10.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <version>${cxf.version}</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>wsdl2java</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
          </dependency>
          <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-annotate</artifactId>
            <version>1.0.1</version>
          </dependency>
          <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-fluent-api</artifactId>
            <version>3.0</version>
          </dependency>
          <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics</artifactId>
            <version>0.9.0</version>
          </dependency>
        </dependencies>
        <configuration>
          <sourceRoot>${project.build.directory}/generated-sources</sourceRoot>
          <wsdlRoot>${basedir}/src/main/resources/wsdl</wsdlRoot>
          <defaultOptions>
            <bindingFiles>
              <bindingFile>${basedir}/src/main/resources/wsdl-binding/ocpp_binding.xml</bindingFile>
              <bindingFile>${basedir}/src/main/resources/wsdl-binding/async_binding.xml</bindingFile>
              <bindingFile>${basedir}/src/main/resources/wsdl-binding/add_interface.xml</bindingFile>
            </bindingFiles>
            <extraargs>
              <extraarg>-xjc-Xfluent-api</extraarg>
              <extraarg>-xjc-Xinheritance</extraarg>
              <extraarg>-xjc-Xannotate</extraarg>
              <extraarg>-exsh</extraarg>
              <extraarg>true</extraarg>
            </extraargs>
          </defaultOptions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>1.5.3</version>
        <executions>
          <execution>
            <id>add-request-interface</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <filesToInclude>${basedir}/src/main/resources/OCPP-2.0.1_part3_JSON_schemas/*Request.json</filesToInclude>
              <preserveDir>false</preserveDir>
              <outputDir>${project.build.directory}/generated-resources</outputDir>
              <replacements>
                <replacement>
                  <token>"definitions"</token>
                  <value>"javaInterfaces" : ["de.rwth.idsg.ocpp.jaxb.RequestType"],
  "definitions"</value>
                </replacement>
              </replacements>
            </configuration>
          </execution>
          <execution>
            <id>add-response-interface</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>replace</goal>
            </goals>
            <configuration>
              <filesToInclude>${basedir}/src/main/resources/OCPP-2.0.1_part3_JSON_schemas/*Response.json</filesToInclude>
              <preserveDir>false</preserveDir>
              <outputDir>${project.build.directory}/generated-resources</outputDir>
              <replacements>
                <replacement>
                  <token>"definitions"</token>
                  <value>"javaInterfaces" : ["de.rwth.idsg.ocpp.jaxb.ResponseType"],
  "definitions"</value>
                </replacement>
              </replacements>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jsonschema2pojo</groupId>
        <artifactId>jsonschema2pojo-maven-plugin</artifactId>
        <version>1.1.1</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDirectory>${project.build.directory}/generated-resources</sourceDirectory>
          <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
          <targetPackage>ocpp._2020._03</targetPackage>
          <generateBuilders>true</generateBuilders>
          <includeJsr303Annotations>true</includeJsr303Annotations>
          <useJodaDates>true</useJodaDates>
          <useJodaLocalDates>true</useJodaLocalDates>
          <useJodaLocalTimes>true</useJodaLocalTimes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
