<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>de.knightsoft-net</groupId>
  <artifactId>gin</artifactId>
  <version>4.0.0</version>
  <packaging>jar</packaging>

  <name>Gin</name>
  <description>Gin (GWT INjection) brings automatic dependency injection to GWT client-side code. Gin is built on top of Guice and uses (a subset of) Guice's binding language.</description>

  <!-- Provide exact url for proper relative urls, even though parent has a redirect file -->
  <url>http://gwtplus.github.io/google-gin/site</url>
  <inceptionYear>2008</inceptionYear>

  <organization>
    <name>GWT Plus</name>
    <url>https://github.com/gwtplus/</url>
  </organization>

  <mailingLists>
    <mailingList>
      <name>Gin Users</name>
      <archive>http://groups.google.com/group/google-gin/topics</archive>
      <subscribe>http://groups.google.com/group/google-gin/subscribe</subscribe>
      <unsubscribe>http://groups.google.com/group/google-gin/subscribe</unsubscribe>
      <post>http://groups.google.com/group/google-gin/post</post>
    </mailingList>
  </mailingLists>

  <developers>
    <developer>
      <id>bstoler</id>
      <name>Brian Stoler</name>
    </developer>
    <developer>
      <id>aragos</id>
      <name>Peter Schmitt</name>
    </developer>
    <developer>
      <id>limpbizkit</id>
      <name>Jesse Wilson</name>
    </developer>
    <developer>
      <id>robbie.vanbrabant</id>
      <name>Robbie Vanbrabant</name>
    </developer>
    <developer>
      <id>fazal.asim</id>
      <name>Fazal Asim</name>
    </developer>
    <developer>
      <id>dburrows</id>
      <name>Daniel Burrows</name>
    </developer>
    <developer>
      <id>scottb</id>
      <name>Scott Blum</name>
    </developer>
    <developer>
      <id>awiner</id>
      <name>Adam Winer</name>
    </developer>
    <developer>
      <id>philippe.beaudoin</id>
      <name>Philippe Beaudoin</name>
    </developer>
    <developer>
      <id>bchambers</id>
      <name>Ben Chambers</name>
    </developer>
  </developers>

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

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/ManfredTremmel/google-gin/issues</url>
  </issueManagement>

  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/gwtplus/google-gin</url>
  </ciManagement>

  <scm>
    <connection>scm:git:https://github.com/ManfredTremmel/google-gin.git</connection>
    <developerConnection>scm:git:https://github.com/ManfredTremmel/google-gin.git</developerConnection>
    <url>https://github.com/ManfredTremmel/google-gin</url>
    <tag>HEAD</tag>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <java.release>11</java.release>
    <guice.version>7.0.0</guice.version>
    <gwt.version>2.12.1</gwt.version>

    <jsr330.version>2.0.1</jsr330.version> <!-- @Inject, @Singleton -->
    <jsr305.version>3.0.2</jsr305.version> <!-- @Nullable -->
    <jsr250.version>3.0.0</jsr250.version> <!-- @Generated, @PostConstruct -->
  </properties>

  <dependencies>
    <!-- JSR-330 -->
    <dependency>
      <groupId>jakarta.inject</groupId>
      <artifactId>jakarta.inject-api</artifactId>
      <version>${jsr330.version}</version>
      <!-- with our internal jakarta.inject.Inject.gwt.xml module -->
    </dependency>
    <dependency>
      <groupId>jakarta.inject</groupId>
      <artifactId>jakarta.inject-api</artifactId>
      <version>${jsr330.version}</version>
      <classifier>sources</classifier>
    </dependency>

    <!-- Guice and AssitedInject extension -->
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-assistedinject</artifactId>
      <version>${guice.version}</version>
    </dependency>

    <!-- GWT -->
    <dependency>
      <groupId>org.gwtproject</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.gwtproject</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Common Annotations -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>${jsr305.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>${jsr250.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>5.5.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.6.0</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
              <configLocation>src/config/gwt-checkstyle.xml</configLocation>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>10.21.1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.13.0</version>
        <configuration>
          <source>${java.release}</source>
          <target>${java.release}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>client-sources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.sourceDirectory}</directory>
                  <include>com/google/gwt/inject/client/**/*.java</include>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.2</version>
        <configuration>
          <!-- test-rebind -->
          <includes>
            <include>com/google/gwt/inject/rebind/**/*Test.java</include>
          </includes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.5.2</version>
        <configuration>
          <includes>
            <include>com/google/gwt/inject/*TestSuite.java</include>
          </includes>

          <additionalClasspathElements>
            <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
          </additionalClasspathElements>

          <useManifestOnlyJar>false</useManifestOnlyJar>

          <forkCount>1C</forkCount>
          <reuseForks>false</reuseForks>
        </configuration>
        <executions>
          <execution>
            <id>test-devmode</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
              <systemPropertyVariables>
                <!-- Add -logLevel TRACE to get more debug output -->
                <gwt.args>
                  -devMode
                  -gen target/generated-test-sources/test-devmode
                  -war target/war/test-devmode
                </gwt.args>
              </systemPropertyVariables>
              <reportsDirectory>${project.build.directory}/failsafe-reports/test-devmode</reportsDirectory>
            </configuration>
          </execution>
          <execution>
            <id>test-web</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
              <systemPropertyVariables>
                <!-- Add -logLevel TRACE to get more debug output -->
                <gwt.args>
                  -prod -style PRETTY
                  -gen target/generated-test-sources/test-web
                  -war target/war/test-web
                </gwt.args>
              </systemPropertyVariables>
              <reportsDirectory>${project.build.directory}/failsafe-reports/test-web</reportsDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <!-- Original name and company -->
              <Specification-Title>GIN (GWT INjection)</Specification-Title>
              <Specification-Vendor>Google Inc.</Specification-Vendor>

              <!-- Java 9 compatibility -->
              <Automatic-Module-Name>com.google.gwt.inject</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.21.0</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>2.0.0</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <!-- TODO: More reporting? test coverage? -->
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.8.0</version>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <!-- TODO: Fix javadoc warnings -->
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.11.2</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <links>
                <link>https://google.github.io/guice/api-docs/latest/javadoc/</link>
                <link>http://www.gwtproject.org/javadoc/latest/</link>
              </links>
              <detectJavaApiLink>true</detectJavaApiLink>
              <quite>true</quite>
              <doclint>none</doclint>
              <source>8</source>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
              <tagNameFormat>v@{project.version}</tagNameFormat>
              <developmentVersion>HEAD-SNAPSHOT</developmentVersion>
              <pushChanges>false</pushChanges>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.7.0</version>
            <extensions>true</extensions>
            <configuration>
              <!-- The Base URL of Nexus instance where we want to stage -->
              <serverId>sonatype-nexus-staging</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ci</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>3.9.0</version>
            <configuration>
              <streamLogs>true</streamLogs>
              <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
