<?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>com.mikesamuel</groupId>
  <artifactId>json-sanitizer</artifactId>
  <packaging>jar</packaging>

  <!--
    When the version ends with "-SNAPSHOT", then `mvn deploy` moves it to
    the snapshot directory instead of into staging proper.
   -->
  <version>1.2.2</version>
  <name>json-sanitizer</name>
  <description>
Given JSON-like content, converts it to valid JSON.

This can be attached at either end of a data-pipeline to help satisfy
Postel's principle:

    be conservative in what you do, be liberal in what you accept from
    others

Applied to JSON-like content from others, it will produce well-formed
JSON that should satisfy any parser you use.

Applied to your output before you send, it will coerce minor mistakes in
encoding and make it easier to embed your JSON in HTML and XML.
  </description>
  <url>https://github.com/OWASP/json-sanitizer</url>

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

  <scm>
    <connection>scm:git:git://github.com/OWASP/json-sanitizer.git</connection>
    <developerConnection>scm:git:git://github.com/OWASP/json-sanitizer.git</developerConnection>
    <url>https://github.com/OWASP/json-sanitizer</url>
  </scm>

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

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/OWASP/json-sanitizer/issues</url>
  </issueManagement>

  <organization>
    <name>OWASP</name>
    <url>https://owasp.org</url>
  </organization>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Maven doesn't provide by it's hidden super pom a version, so enforce here -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <!-- Latest fluido needs 3.6+ -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.8.2</version>
        </plugin>
        <!-- Support running through sonar -->
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>3.7.0.1746</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <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>
          <!-- This staging profile ID gleaned by logging in to
               oss.sonatype.org, clicking "Staging Profiles" on the left,
               selecting "com.mikesamuel", and extracting the most hexy
               looking bit from the URL which looks like
               https://oss.sonatype.org/#stagingProfiles;5fd62edf6679f6
          -->
          <stagingProfileId>5fd62edf6679f6</stagingProfileId>
          <executions>
            <execution>
              <id>default-deploy</id>
              <phase>deploy</phase>
              <goals>
                <goal>deploy</goal>
              </goals>
            </execution>
          </executions>
        </configuration>
      </plugin>
      <!-- For building the source jar. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- For building the javadoc jar. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <nohelp>true</nohelp>
          <show>public</show>
          <doctitle>JSON Sanitizer</doctitle>
        </configuration>
      </plugin>

      <!-- http://www.javaworld.com/article/2074515/core-java/
           unit-test-code-coverage-with-maven-and-jacoco.html -->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.5</version>
        <configuration>
          <destFile>${project.basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
          <dataFile>${project.basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
        </configuration>
        <executions>
          <execution>
            <id>jacoco-initialize</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site</id>
            <phase>package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <developers>
    <developer>
      <id>mikesamuel</id>
      <name>Mike Samuel</name>
      <email>mikesamuel@gmail.com</email>
    </developer>
  </developers>

  <mailingLists>
    <mailingList>
      <name>User Support List</name>
      <subscribe>json-sanitizer-support+subscribe@googlegroups.com</subscribe>
      <unsubscribe>json-sanitizer-support+unsubscribe@googlegroups.com</unsubscribe>
      <archive>https://groups.google.com/forum/#!forum/json-sanitizer-support</archive>
    </mailingList>
  </mailingLists>

  <dependencies>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <reporting>
    <plugins>
      <!-- `mvn compile site` will generate target/site/findbugs.html -->
      <!-- http://gleclaire.github.io/findbugs-maven-plugin/dependency-info.html -->
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>3.1.12.2</version>
        <configuration>
          <!--
            Enables analysis which takes more memory but finds more bugs.
            If you run out of memory, changes the value of the effort element
            to 'Low'.
          -->
          <effort>Max</effort>
          <!-- Reports all bugs (other values are medium and max) -->
          <threshold>Low</threshold>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <properties>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>

    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <profiles>
    <profile>
      <id>release-sign-artifact</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>
    <profile>
      <id>jdk12on</id>
      <activation>
        <jdk>[12,)</jdk>
      </activation>
      <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
      </properties>
    </profile>
  </profiles>
</project>
