<?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">
    <parent>
        <artifactId>j2asyncapi</artifactId>
        <groupId>lu.greenhalos</groupId>
        <version>0.2.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>j2asyncapi-schema</artifactId>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <configuration>
                    <nodeVersion>v16.14.0</nodeVersion>
                    <npmVersion>8.3.1</npmVersion>
                </configuration>
                <executions>
                    <execution>
                        <id>install-node-and-npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>npm-install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <configuration>
                    <initializeCollections>false</initializeCollections>
                    <includeHashcodeAndEquals>true</includeHashcodeAndEquals>
                </configuration>
                <executions>
                    <execution>
                        <id>asyncapi</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <phase>process-resources</phase>
                        <configuration>
                            <sourceDirectory>${basedir}/src/main/resources/schemas/asyncapi</sourceDirectory>
                            <targetPackage>lu.greenhalos.j2asyncapi.schemas</targetPackage>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
