<?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>
    <parent>
        <groupId>io.github.dnalchemist.mapstruct.spi</groupId>
        <artifactId>spi-protobuf-parent</artifactId>
        <version>1.47</version>
    </parent>
    <artifactId>protobuf-usage</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>dev.cookiecode</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>${protobuf.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <protocArtifact>com.google.protobuf:protoc:${proto.version}:exe:${os.detected.classifier}</protocArtifact>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <!-- Add your SPI implementation. -->
                            <groupId>io.github.dnalchemist.mapstruct.spi</groupId>
                            <artifactId>protobuf-spi-impl</artifactId>
                            <version>${project.version}</version>
                            <!-- In real life, this should be a fixed version from a different
                  reactor project and not be part of the same multi-module project. Maven wouldn't
                  be able to consider that in the build-order calculation and might pull in
                  the spi-impl from a previous build (especially tricky in multi-threaded builds).
                  For Eclipse, there would be similar problems, as it can't reference build
                  artifacts of workspace projects in the processor classpath but only jar-files
                  (in this case from the local M2-repo cache). -->
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        <arg>-AmapstructSpi.enumPostfixOverrides=io.github.dnalchemist.mapstruct.example.EnumPostfixOverrideProtos=INVALID</arg>
                        <arg>-AmapstructSpi.useEnumRawValue=true</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>${os.mavenplugin.version}</version>
            </extension>
        </extensions>
    </build>
</project>
