<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>cloud.localstack</groupId>
    <artifactId>localstack-sdk-parent</artifactId>
    <packaging>pom</packaging>
    <name>localstack-sdk-parent</name>
    <version>0.0.1</version>

    <description>Parent POM for localstack-sdk Java project</description>

    <modules>
        <module>localstack-sdk-generated</module>
        <module>localstack-sdk-java</module>
    </modules>

    <url>http://localstack.cloud</url>
    <developers>
        <developer>
            <id>localstack-team</id>
            <name>LocalStack Contributors</name>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/localstack/localstack</url>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.6.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>generate-code</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openapitools</groupId>
                        <artifactId>openapi-generator-maven-plugin</artifactId>
                        <version>7.9.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <generatorName>java</generatorName>
                                    <inputSpec>${project.basedir}/localstack-spec-latest.yml</inputSpec>
                                    <output>${project.basedir}/localstack-sdk-generated</output>
                                    <cleanupOutput>true</cleanupOutput>
                                    <apiPackage>cloud.localstack.generated.api</apiPackage>
                                    <invokerPackage>cloud.localstack.generated.invoker</invokerPackage>
                                    <modelPackage>cloud.localstack.generated.model</modelPackage>
                                    <skipValidateSpec>true</skipValidateSpec>
                                    <ignoreFileOverride>${project.basedir}/.openapi-generator-ignore</ignoreFileOverride>
                                    <groupId>cloud.localstack</groupId>
                                    <artifactId>localstack-sdk-generated</artifactId>
                                    <artifactVersion>0.0.1</artifactVersion>
                                    <templateDirectory>${project.basedir}/templates</templateDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
