<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.classgraph</groupId>
    <artifactId>classgraph</artifactId>
    <version>4.8.44</version>
    <name>ClassGraph</name>

    <description>The uber-fast, ultra-lightweight classpath and module scanner for JVM languages.</description>

    <url>https://github.com/classgraph/classgraph</url>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Luke Hutchison</name>
            <email>luke.hutch@gmail.com</email>
            <organization>--</organization>
            <organizationUrl>https://github.com/lukehutch</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:classgraph/classgraph.git</connection>
        <developerConnection>scm:git:git@github.com:classgraph/classgraph.git</developerConnection>
        <url>https://github.com/classgraph/classgraph</url>
        <tag>classgraph-4.8.44</tag>
    </scm>

    <issueManagement>
        <url>https://github.com/classgraph/classgraph/issues</url>
    </issueManagement>

    <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>
    </distributionManagement>

    <properties>
        <!-- Set UTF-8 encoding for Maven plugins and output -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Default to generating Javadoc in HTML 4.01 format -->
        <javadoc.html.version />
        
        <!-- Warnings are disabled, in order to suppress warning about bootstrap classpath not being set -->
        <!-- (which arises as a result of building for JDK 7 on JDK8+, allowing for use of @FunctionalInterface) -->
        <!-- <maven.compiler.showWarnings>true</maven.compiler.showWarnings> -->
        <!-- <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation> -->
    </properties>

    <build>
        <plugins>
            <!-- Plugins are listed here, but configured in pluginManagement, for compatibility with Eclipse. -->
            <!-- See: https://stackoverflow.com/a/10483284/3950982 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </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.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>

        <pluginManagement>
            <!-- Plugins. Find updates with: mvn versions:display-plugin-updates -->
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0-M2</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>animal-sniffer-enforcer-rule</artifactId>
                            <version>1.17</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <!-- Check main project for compatibility with JDK 7 API -->
                        <execution>
                            <id>check-signatures</id>
                            <phase>test</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <checkSignatureRule implementation="org.codehaus.mojo.animal_sniffer.enforcer.CheckSignatureRule">
                                        <signature>
                                            <groupId>org.codehaus.mojo.signature</groupId>
                                            <!-- Check against JDK 7 API -->
                                            <artifactId>java17</artifactId>
                                            <version>1.0</version>
                                        </signature>
                                    </checkSignatureRule>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Compile sources (main for JDK 7, test for JDK 8) -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <!-- Can't use "release" option, because ClassGraph needs to be built in JDK 7 -->
                        <!-- compatibility mode, and the @FunctionalInterface annotation was not available -->
                        <!-- in JDK 7. If building with "source" and "target" switches, unknown annotations -->
                        <!-- compile fine as long as they exist in the compiling JDK (in this case, JDK 8+). -->
                        <!-- Missing annotations don't trigger a linkage error or ClassNotFoundException -->
                        <!-- unless the annotation is actually read. -->
                        <!-- However, note that not explicitly specifying a JDK 7 rt.jar as the bootstrap -->
                        <!-- classpath (in order to build on a newer JDK, which does have @FunctionalInterface) -->
                        <!-- will lead to the following build-time warning, if maven.compiler.showWarnings -->
                        <!-- is set to true: -->
                        <!-- "[WARNING] bootstrap class path not set in conjunction with -source 7"-->
                        <source>7</source>
                        <target>7</target>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-testCompile</id>
                            <phase>test-compile</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                            <configuration>
                                <encoding>UTF-8</encoding>
                                <!-- Tests use some JDK 8 features, such as lambdas -->
                                <source>8</source>
                                <target>8</target>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Execute unit tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M3</version>
                </plugin>

                <!-- Create and bundle manifest file -->
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>4.1.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-Category>Utilities</Bundle-Category>
                            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                            <Bundle-Description>${project.description}</Bundle-Description>
                            <Bundle-Vendor>Luke Hutchison</Bundle-Vendor>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>bundle-manifest</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Compile module-info.class using ModiTect, and place it in META-INF/versions/9 -->
                <plugin>
                    <!-- In the future, rather than using ModiTect, could use two execute rules. -->
                    <!-- See: https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html -->
                    <groupId>org.moditect</groupId>
                    <artifactId>moditect-maven-plugin</artifactId>
                    <version>1.0.0.Beta2</version>
                    <executions>
                        <execution>
                            <id>add-module-infos</id>
                            <phase>package</phase>
                            <goals>
                                <goal>add-module-info</goal>
                            </goals>
                            <configuration>
                                <!-- Put module-info.class in META-INF/versions/9 to maximize backwards compat -->
                                <!-- See: https://github.com/moditect/moditect/issues/67 -->
                                <jvmVersion>9</jvmVersion>
                                <overwriteExistingFiles>true</overwriteExistingFiles>
                                <module>
                                    <!-- VersionFinder requires java.xml -->
                                    <!-- FileUtils requires jdk.unsupported (for usage of Unsafe) -->
                                    <!-- ModulePathInfo requires java.management -->
                                    <!-- LogNode requires java.logging -->
                                    <moduleInfoSource>
                                        /** ${project.name}: ${project.description} ( ${project.url} ) */
                                        module
                                        io.github.classgraph {
                                        exports io.github.classgraph;
                                        requires java.xml;
                                        requires jdk.unsupported;
                                        requires java.management;
                                        requires java.logging;
                                        }
                                    </moduleInfoSource>
                                </module>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Add src/test/perf to test sources -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.0.0</version>
                    <executions>
                        <execution>
                            <id>add-test-source</id>
                            <phase>generate-test-sources</phase>
                            <goals>
                                <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>src/test/perf</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Create binary jar -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <archive>
                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>

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

                <!-- Create Javadoc jar -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.0.1</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <doclint>none</doclint>
                                <additionalOptions>${javadoc.html.version}</additionalOptions>
                                <excludePackageNames>nonapi.*</excludePackageNames>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Stage jars on Sonatype Nexus -->
                <!-- See: http://java.dzone.com/articles/deploy-maven-central -->
                <!-- and: http://central.sonatype.org/pages/apache-maven.html -->
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>

                <!-- Deploy jars to Maven Central -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- Test dependencies (main has no dependencies). -->
    <!-- Find dependency updates with: mvn versions:display-dependency-updates -->
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.5.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
            <version>1.21</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <version>1.21</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.11.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.0-SP4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-aether</artifactId>
            <version>2.6.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.8.0-beta2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.8.0-beta2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.2.Final</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <!-- Compile Javadoc to HTML5 if building with JDK 9+ -->
        <profile>
            <id>jdk9plus</id>
            <properties>
                <javadoc.html.version>-html5</javadoc.html.version>
                <!-- coverall version 4.3.0 does not work with java 9. -->
                <!-- See: https://github.com/trautonen/coveralls-maven-plugin/issues/112 -->
                <coveralls.skip>true</coveralls.skip>
            </properties>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
        </profile>

        <!-- Sign jars for release (mvn release:prepare && mvn release:perform) -->
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Lifecycle mapping for eclipse m2e compatibility. -->
        <!-- See: https://stackoverflow.com/a/23707050/3950982 -->
        <profile>
            <id>only-eclipse</id>
            <activation>
                <property>
                    <!-- Only activate in m2e -->
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <!-- Putting this in pluginManagement causes Maven and IDEA to ignore this "plugin" -->
                <!-- (the lifecycle-mapping plugin doesn't actually exist, it is a special artifactId -->
                <!-- recognized only by m2e). -->
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <!-- Cause m2e to ignore maven-enforcer-plugin (which does not have a -->
                                <!-- corresponding m2e connector, so otherwise triggers a warning). -->
                                <!-- See: https://stackoverflow.com/a/13043842/3950982 -->
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-enforcer-plugin</artifactId>
                                                <versionRange>[1.0.0,)</versionRange>
                                                <goals>
                                                    <goal>enforce</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore />
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
