<?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>apicurio-registry-schema-validation</artifactId>
        <groupId>io.apicurio</groupId>
        <version>0.0.4.Final</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>apicurio-registry-schema-validation-protobuf</artifactId>

    <properties>
        <protobuf.version>3.21.6</protobuf.version>
        <!-- Proto -->
        <proto-plugin.version>0.6.1</proto-plugin.version>
        <os-maven-plugin.version>1.7.0</os-maven-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-schema-resolver</artifactId>
        </dependency>
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-protobuf-schema-utilities</artifactId>
        </dependency>
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-schema-util-protobuf</artifactId>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.6.2</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>detect</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>${proto-plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>gencode</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <protocArtifact>
                                com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
                            </protocArtifact>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>