<?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>io.github.dodogeny</groupId>
    <artifactId>bastion-maven-plugin-parent</artifactId>
    <version>1.1.0</version>
    <packaging>pom</packaging>

    <name>Bastion Maven Plugin - Community Edition</name>
    <description>Community edition of Bastion Maven Plugin - Open source vulnerability scanner for Maven projects</description>
    <url>https://github.com/dodogeny/bastion-maven-plugin-community</url>

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

    <developers>
        <developer>
            <id>dodogeny</id>
            <name>Javed Neemuth</name>
            <email>dil.neemuth@gmail.com</email>
        </developer>
    </developers>

    <organization>
        <name>Dodogeny</name>
        <url>https://github.com/dodogeny/bastion-maven-plugin-community</url>
    </organization>

    <scm>
        <url>https://github.com/dodogeny/bastion-maven-plugin-community</url>
        <connection>scm:git:git://github.com/dodogeny/bastion-maven-plugin-community.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:dodogeny/bastion-maven-plugin-community.git</developerConnection>
    </scm>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <gpg.skip>false</gpg.skip>

        <!-- Dependency versions (JDK 21+ compatible) -->
        <maven.version>3.8.6</maven.version>
        <junit.version>5.9.3</junit.version>
        <mockito.version>4.11.0</mockito.version>
        <slf4j.version>1.7.36</slf4j.version>
        <jackson.version>2.15.2</jackson.version>
        <h2.version>2.3.232</h2.version>
        <postgresql.version>42.6.0</postgresql.version>
        <owasp-dc.version>12.1.3</owasp-dc.version>
        <flyway.version>8.5.13</flyway.version>
        <freemarker.version>2.3.31</freemarker.version>
        <openhtmltopdf.version>1.0.10</openhtmltopdf.version>
        <github-api.version>1.314</github-api.version>
        <httpclient5.version>5.4.3</httpclient5.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <commons-io.version>2.11.0</commons-io.version>
        <caffeine.version>2.9.3</caffeine.version>
    </properties>

    <modules>
        <module>vulnerability-db</module>
        <module>scanner-core</module>
        <module>reporting</module>
        <module>plugin</module>
        <module>distribution</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Jackson BOM for consistent versions -->
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            
            <!-- Internal modules -->
            <dependency>
                <groupId>io.github.dodogeny</groupId>
                <artifactId>bastion-vulnerability-community-db</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.dodogeny</groupId>
                <artifactId>bastion-scanner-community-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.dodogeny</groupId>
                <artifactId>bastion-reporting-community</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.dodogeny</groupId>
                <artifactId>bastion-maven-community-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>
            

            <!-- External dependencies -->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${maven.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${maven.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>3.10.2</version>
            </dependency>
            
            <!-- OWASP Dependency-Check -->
            <dependency>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-core</artifactId>
                <version>${owasp-dc.version}</version>
            </dependency>
            
            <!-- Database -->
            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-core</artifactId>
                <version>${flyway.version}</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${h2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>${postgresql.version}</version>
            </dependency>
            
            <!-- JSON Processing - Explicit versions to override OWASP transitive deps -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            
            <!-- Template Engine -->
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>${freemarker.version}</version>
            </dependency>
            
            <!-- PDF Generation -->
            <dependency>
                <groupId>com.openhtmltopdf</groupId>
                <artifactId>openhtmltopdf-pdfbox</artifactId>
                <version>${openhtmltopdf.version}</version>
            </dependency>
            
            <!-- HTTP Client -->
            <dependency>
                <groupId>org.apache.httpcomponents.client5</groupId>
                <artifactId>httpclient5</artifactId>
                <version>${httpclient5.version}</version>
            </dependency>
            
            <!-- GitHub API -->
            <dependency>
                <groupId>org.kohsuke</groupId>
                <artifactId>github-api</artifactId>
                <version>${github-api.version}</version>
            </dependency>
            
            <!-- Utilities -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            
            <!-- Caching -->
            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>${caffeine.version}</version>
            </dependency>
            
            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            
            <!-- Testing -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <configuration>
                        <source>21</source>
                        <target>21</target>
                        <release>21</release>
                    </configuration>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.10.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.4.0</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                    <configuration>
                        <skip>${gpg.skip}</skip>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.11</version>
                </plugin>
                
                <!-- Maven Site Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>4.0.0-M13</version>
                    <configuration>
                        <generateReports>true</generateReports>
                        <inputEncoding>UTF-8</inputEncoding>
                        <outputEncoding>UTF-8</outputEncoding>
                        <locales>en</locales>
                    </configuration>
                </plugin>
                
                <!-- Project Info Reports -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.4.5</version>
                </plugin>

                <!-- JXR Plugin for Source Code Cross-Reference -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jxr-plugin</artifactId>
                    <version>3.3.2</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <toolchains>
                        <jdk>
                            <version>21</version>
                        </jdk>
                    </toolchains>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            
            <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>
                <version>0.6.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <reporting>
        <plugins>
            <!-- Project Info Reports -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.4.5</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>summary</report>
                            <report>dependency-info</report>
                            <report>modules</report>
                            <report>team</report>
                            <report>scm</report>
                            <report>issue-management</report>
                            <report>licenses</report>
                            <report>dependencies</report>
                            <report>dependency-management</report>
                            <report>dependency-convergence</report>
                            <report>plugins</report>
                            <report>plugin-management</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <!-- JavaDoc Reports -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>javadoc</report>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <source>21</source>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <charset>UTF-8</charset>
                    <additionalparam>-Xdoclint:none</additionalparam>
                    <additionalJOptions>
                        <additionalJOption>-Xdoclint:none</additionalJOption>
                    </additionalJOptions>
                    <show>private</show>
                    <nohelp>true</nohelp>
                    <failOnError>false</failOnError>
                    <quiet>true</quiet>
                </configuration>
            </plugin>

            <!-- Source Code Cross-Reference -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.3.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>jxr</report>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <!-- Test Coverage Reports -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.11</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <!-- Surefire Test Reports -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.2.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <!-- FindBugs/SpotBugs Reports -->
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>4.8.2.0</version>
                <configuration>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>

        </plugins>
    </reporting>
</project>