<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>com.webfuzzing</groupId>
    <artifactId>commons</artifactId>

    <version>0.0.5</version>

    <inceptionYear>2024</inceptionYear>
    <name>WFC</name>
    <description>Web Fuzzing Commons: A Set of Utilities for Fuzzing Web Applications</description>
    <url>webfuzzing.com</url>
    <packaging>jar</packaging>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/WebFuzzing/commons/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/WebFuzzing/commons.git</connection>
        <developerConnection>scm:git:https://github.com/WebFuzzing/commons.git</developerConnection>
        <url>https://github.com/WebFuzzing/commons/tree/master</url>
    </scm>

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

    <developers>
        <developer>
            <id>arcuri82</id>
            <name>Andrea Arcuri</name>
            <email>arcuri82@gmail.com</email>
            <url>https://github.com/WebFuzzing</url>
            <timezone>2</timezone>
            <roles>
                <role>Architect/Developer</role>
            </roles>
        </developer>
    </developers>

    <properties>
        <java.version>1.8</java.version>
        <junit.jupiter.version>5.7.2</junit.jupiter.version>
        <junit.platform.version>1.7.2</junit.platform.version>
    </properties>



    <dependencies>

        <!-- test dependencies -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.16.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>${junit.platform.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <profiles>
        <profile>
            <!--
                   This profile is needed when making a deployment to Maven Central.

                   1) update version.
                      Git push.
                      Don't forget to update release_notes.md before preparing a new release

                   2) run:
                   mvn  -P release -DskipTests  deploy
                   git tag v<x.y.z>
                   git push origin v<x.y.z>

                   3) put back -SNAPSHOT
              -->
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <build>

        <pluginManagement>
            <plugins>
                <!-- To deploy to Maven Central
                    https://central.sonatype.com/account
                    https://central.sonatype.org/publish/publish-portal-maven/
                -->
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.7.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                    </configuration>
                </plugin>
                <!-- To sign Jar files before uploading them to Maven Central -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <version>1.2.2</version>
                <configuration>
                    <!--  https://joelittlejohn.github.io/jsonschema2pojo/site/1.0.2/generate-mojo.html  -->
                    <annotationStyle>none</annotationStyle>
                    <includeGeneratedAnnotation>false</includeGeneratedAnnotation>
                    <sourceType>yamlschema</sourceType>
                    <useJodaDates>false</useJodaDates>
                    <formatDateTimes>true</formatDateTimes>
                    <formatDates>true</formatDates>
                    <formatTimes>true</formatTimes>
                    <dateType>java.lang.String</dateType>
                    <dateTimeType>java.lang.String</dateTimeType>
                    <timeType>java.lang.String</timeType>
                </configuration>
                <executions>
                    <execution>
                        <id>report.yaml</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${basedir}/src/main/resources/wfc/schemas/report.yaml</sourceDirectory>
                            <targetPackage>com.webfuzzing.commons.report</targetPackage>
                        </configuration>
                    </execution>
                    <execution>
                        <id>auth.yaml</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${basedir}/src/main/resources/wfc/schemas/auth.yaml</sourceDirectory>
                            <targetPackage>com.webfuzzing.commons.auth</targetPackage>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>yarn install build</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>yarn</executable>
                            <arguments>
                                <argument>installAndBuild</argument>
                            </arguments>
                            <workingDirectory>${project.basedir}/web-report</workingDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>create-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <source>8</source>
                </configuration>
                <executions>
                    <execution>
                        <id>create-javadocs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.surefire</groupId>
                <artifactId>surefire</artifactId>
                <version>3.5.3</version>
            </plugin>
        </plugins>
    </build>

</project>