<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.airlift</groupId>
        <artifactId>guice-parent</artifactId>
        <version>10</version>
    </parent>

    <artifactId>guice</artifactId>

    <name>Google Guice - Core Library</name>

    <description>Guice core library</description>

    <dependencies>
        <dependency>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <exclusions>
                <exclusion>
                    <!-- annotations-only, not needed at runtime or compile -->
                    <groupId>com.google.j2objc</groupId>
                    <artifactId>j2objc-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jspecify</groupId>
            <artifactId>jspecify</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava-testlib</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.truth</groupId>
            <artifactId>truth</artifactId>
            <scope>test</scope>
        </dependency>
        <!--
     | Test dependencies
    -->
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-tck</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <!--
                     | Stock Guice publishes an unshaded "classes" classifier that airlift's poms depend
                     | on. Our main jar IS the unshaded classes, so attach it under that classifier too,
                     | letting ecosystem builds resolve this fork without coordinate changes.
                    -->
                        <id>classes-classifier</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>classes</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--
       | Add standard LICENSE and NOTICE files
      -->
            <plugin>
                <artifactId>maven-remote-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--
           | Temporarily excluded tests
          -->
                    <excludes>
                        <exclude>**/*$*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>with-windows-line-separators</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <!-- enable ShowHiddenFrames to help tests find AOP frames on Java17 -->
                            <argLine>-Dline.separator='\r\n' -XX:+UnlockDiagnosticVMOptions -XX:+ShowHiddenFrames</argLine>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--
       | Remove duplicate jarjar'd LICENSE and NOTICE
      -->
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>LICENSE</exclude>
                        <exclude>NOTICE</exclude>
                    </excludes>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>com.google.guice</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <!--
       | Generate sources jar
      -->
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <!--
       | Generate javadoc jar
      -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!--
       | m2e profile - enable use of JarJar inside Eclipse
      -->
            <id>m2e</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.sonatype.plugins</groupId>
                                                <artifactId>jarjar-maven-plugin</artifactId>
                                                <versionRange>[1.4,)</versionRange>
                                                <goals>
                                                    <goal>jarjar</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <execute />
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
