<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

      https://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
  -->
<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>org.apache.plc4x</groupId>
    <artifactId>plc4x-code-generation</artifactId>
    <version>0.10.0</version>
  </parent>

  <artifactId>plc4x-code-generation-language-java</artifactId>

  <name>Code-Generation: Language: Java</name>
  <description>Code generation template for generating Java code</description>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <!-- Install the current project artifacts into the maven local repo, so they can be used in the test -->
              <goal>install</goal>
              <!-- Execute the maven builds defines in src/test/resources -->
              <goal>integration-test</goal>
              <!-- Checks the results of the maven builds -->
              <goal>verify</goal>
            </goals>
            <configuration>
              <skipInvocation>${skip-code-generation-tests}</skipInvocation>
              <debug>true</debug>
              <streamLogsOnFailures>true</streamLogsOnFailures>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <projectsDirectory>src/test/resources</projectsDirectory>
              <cloneProjectsTo>${project.build.directory}/integration-tests</cloneProjectsTo>
              <settingsFile>src/test/resources/settings.xml</settingsFile>
              <extraArtifacts>
                <extraArtifact>org.apache.plc4x.plugins:plc4x-code-generation-language-base:${plc4x-code-generation.version}</extraArtifact>
                <extraArtifact>org.apache.plc4x.plugins:plc4x-maven-plugin:${plc4x-code-generation.version}</extraArtifact>
                <extraArtifact>org.apache.plc4x.plugins:plc4x-code-generation-protocol-base:${plc4x-code-generation.version}</extraArtifact>
                <extraArtifact>org.apache.plc4x.plugins:plc4x-code-generation-types-base:${plc4x-code-generation.version}</extraArtifact>
              </extraArtifacts>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <!-- The goals we will be executing in the test-projects -->
              <goals>
                <goal>test</goal>
              </goals>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <!-- We are using the Freemarker module to generate Java code -->
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4x-code-generation-language-base-freemarker</artifactId>
      <version>0.10.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4x-code-generation-protocol-base-mspec</artifactId>
      <version>0.10.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.plc4x.plugins</groupId>
      <artifactId>plc4x-code-generation-types-base</artifactId>
    </dependency>

    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.googlejavaformat</groupId>
      <artifactId>google-java-format</artifactId>
    </dependency>

    <!-- Make sure the dependencies of the module are built first -->
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-api</artifactId>
      <version>0.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-spi</artifactId>
      <version>0.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-transport-tcp</artifactId>
      <version>0.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4j-utils-test-utils</artifactId>
      <version>0.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4x-code-generation-protocol-test</artifactId>
      <version>0.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.plc4x</groupId>
      <artifactId>plc4x-code-generation-protocol-test</artifactId>
      <version>0.10.0</version>
      <classifier>tests</classifier>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>
