<?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>

    <groupId>com.contrastsecurity.scan</groupId>
    <artifactId>prescan-datamodel</artifactId>
    <version>0.0.1</version>

    <name>Contrast Scan Prescan Data Model</name>
    <description>
        The data model and serialization for prescan data ingested by Contrast Scan.
    </description>
    <url>https://github.com/Contrast-Security-OSS/contrast-scan-prescan</url>

    <organization>
        <name>Contrast Security, Inc.</name>
        <url>https://contrastsecurity.com</url>
    </organization>

    <developers>
        <developer>
            <name>Contrast Security</name>
            <email>support@contrastsecurity.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <site>
            <id>github</id>
            <url>scm:git:https://github.com/Contrast-Security-OSS/contrast-scan-prescan.git</url>
        </site>
    </distributionManagement>

    <scm>
        <connection>
            scm:git:https://github.com/Contrast-Security-OSS/contrast-scan-prescan.git
        </connection>
        <url>
            scm:git:https://github.com/Contrast-Security-OSS/contrast-scan-prescan.git
        </url>
        <developerConnection>
            scm:git:https://github.com/Contrast-Security-OSS/contrast-scan-prescan.git
        </developerConnection>
        <tag>v0.0.1</tag>
    </scm>

    <properties>
        <versions.commons_lang>2.4</versions.commons_lang>
        <versions.jackson>2.13.0</versions.jackson>
        <versions.maven-compiler-plugin>3.8.1</versions.maven-compiler-plugin>
        <versions.maven-enforcer-plugin>3.0.0-M2</versions.maven-enforcer-plugin>
        <versions.maven-clean-plugin>3.1.0</versions.maven-clean-plugin>
        <versions.jsonschema2pojo-maven-plugin>1.1.1</versions.jsonschema2pojo-maven-plugin>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
          <groupId>commons-lang</groupId>
          <artifactId>commons-lang</artifactId>
           <version>${versions.commons_lang}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${versions.jackson}</version>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${versions.jackson}</version>
        </dependency>
        <dependency>
            <groupId>org.jsonschema2pojo</groupId>
            <artifactId>jsonschema2pojo-jdk-annotation</artifactId>
            <version>0.0.1</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>8</release>
                    <compilerVersion>8</compilerVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <version>${versions.jsonschema2pojo-maven-plugin}</version>
                <configuration>
                    <sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
                    <targetPackage>com.contrastsecurity.scan</targetPackage>
                    <targetVersion>8</targetVersion>
                    <generateBuilders>true</generateBuilders>
                    <inclusionLevel>NON_DEFAULT</inclusionLevel>
                    <initializeCollections>false</initializeCollections>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <tagNameFormat>v@{version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${versions.maven-enforcer-plugin}</version>

                <executions>
                    <execution>
                        <id>enforce</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicatePomDependencyVersions />
                                <requireMavenVersion>
                                    <version>3.3</version>
                                    <message>Invalid Maven version. It should be &gt;= 3.3.</message>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>8</version>
                                    <message>Invalid Java version. It should be &gt;= Java 8.</message>
                                </requireJavaVersion>
                                <dependencyConvergence />
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- Always automatically add license file to generated sources -->
                        <id>update-generated-sources</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-test-sources</phase>
                        <configuration>
                            <roots>${project.build.directory}/generated-sources</roots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <release>8</release>
                    <detectJavaApiLink>false</detectJavaApiLink>
                    <doclet>org.apidesign.javadoc.codesnippet.Doclet</doclet>
                    <docletArtifact>
                        <groupId>org.apidesign.javadoc</groupId>
                        <artifactId>codesnippet-doclet</artifactId>
                        <version>0.61</version>
                    </docletArtifact>
                    <additionalOptions>
                        <additionalOption>
                            -maxLineLength 120
                        </additionalOption>
                    </additionalOptions>
                    <additionalDependencies>
                        <!-- javadoc cannot find the annotations removed in JDK 11, so add them -->
                        <dependency>
                            <groupId>javax.annotation</groupId>
                            <artifactId>javax.annotation-api</artifactId>
                            <version>1.2</version>
                        </dependency>
                    </additionalDependencies>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${versions.maven-clean-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${versions.maven-compiler-plugin}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.0.0</version>
                    <configuration>
                        <licenseName>apache_v2</licenseName>
                        <inceptionYear>2021</inceptionYear>
                        <excludes>
                            <exclude>**/*.json</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                </plugin>
            </plugins>
        </pluginManagement>

    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>