<project>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.salesforce.functions</groupId>
  <artifactId>sf-fx-schema</artifactId>
  <version>1.0.0</version>
  <packaging>pom</packaging>

  <name>com.salesforce.functions:sf-fx-schema</name>
  <description>CloudEvents OpenAPI Schema for Salesforce Functions invocation</description>
  <url>https://github.com/forcedotcom/sf-fx-schema</url>

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <openapi-generator.version>5.4.0</openapi-generator.version>
    <swagger-annotations-version>1.5.22</swagger-annotations-version>
    <jackson-version>2.13.1</jackson-version>
    <jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
    <jakarta-annotation-version>1.3.5</jakarta-annotation-version>
    <junit-version>4.13.1</junit-version>
  </properties>

  <developers>
    <developer>
      <name>D. J. Hagberg</name>
      <email>dhagberg@salesforce.com</email>
      <organization>Salesforce.com, Inc.</organization>
      <organizationUrl>https://www.salesforce.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/forcedotcom/sf-fx-schema.git</connection>
    <developerConnection>scm:git:git://github.com/forcedotcom/sf-fx-schema.git</developerConnection>
    <url>https://github.com/forcedotcom/sf-fx-schema</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
          <groupId>io.swagger</groupId>
          <artifactId>swagger-annotations</artifactId>
          <version>${swagger-annotations-version}</version>
      </dependency>

      <!-- JSON processing: jackson -->
      <dependency>
          <groupId>com.fasterxml.jackson</groupId>
          <artifactId>jackson-bom</artifactId>
          <version>${jackson-version}</version>
          <scope>import</scope>
          <type>pom</type>
      </dependency>
      <dependency>
          <groupId>org.openapitools</groupId>
          <artifactId>jackson-databind-nullable</artifactId>
          <version>${jackson-databind-nullable-version}</version>
      </dependency>

      <!-- @Nullable annotation -->
      <dependency>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
          <version>3.0.2</version>
      </dependency>
      <dependency>
          <groupId>jakarta.annotation</groupId>
          <artifactId>jakarta.annotation-api</artifactId>
          <version>${jakarta-annotation-version}</version>
          <scope>provided</scope>
      </dependency>

      <!-- test dependencies -->
      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>${junit-version}</version>
          <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>11</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</version>
        </plugin>
        <plugin>
          <groupId>org.openapitools</groupId>
          <artifactId>openapi-generator-maven-plugin</artifactId>
          <version>5.4.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.11.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.2.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.2.2</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>index</report>
              <report>licenses</report>
              <report>dependencies</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <!-- "codegen" - do the code generation phases based on toplevel schema.json to replace model class sources -->
      <id>codegen</id>
    </profile>
    <profile>
      <!-- "cibuild" - add artifacts suitable for Continuous Integration such as (java)doc and sources jar's -->
      <id>cibuild</id>
    </profile>
    <profile>
      <id>ossrh</id>
      <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>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.12</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <modules>
    <module>java</module>
    <module>go</module>
    <module>node</module>
  </modules>

</project>
