<?xml version="1.0" encoding="UTF-8"?>
<!-- /**
 * Copyright (c) Codice Foundation
 *
 * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
 * <http://www.gnu.org/licenses/lgpl.html>.
 *
 **/ -->
<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">
  <parent>
    <artifactId>transformer</artifactId>
    <groupId>ddf.catalog.transformer</groupId>
    <version>2.30.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <name>DDF :: Catalog :: Transformer :: HTML</name>
  <packaging>bundle</packaging>

  <artifactId>catalog-transformer-html</artifactId>
  <dependencies>
    <dependency>
      <groupId>ddf.catalog.core</groupId>
      <artifactId>catalog-core-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>ddf.catalog.core</groupId>
      <artifactId>catalog-core-api-impl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>${jsoup.version}</version>
    </dependency>
    <dependency>
      <groupId>ddf.platform</groupId>
      <artifactId>platform-parser-xml</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>ddf.catalog.core</groupId>
      <artifactId>catalog-core-commons</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ddf.platform.util</groupId>
      <artifactId>platform-util</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.jknack</groupId>
      <artifactId>handlebars</artifactId>
      <version>${jknack.handlebars.version}</version>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
      <version>${antlr.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>src/main/resources/default-category-association.config</file>
                  <type>config</type>
                  <classifier>default-category-association</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-contact.config</file>
                  <type>config</type>
                  <classifier>default-category-contact</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-core.config</file>
                  <type>config</type>
                  <classifier>default-category-core</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-dateTime.config</file>
                  <type>config</type>
                  <classifier>default-category-dateTime</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-location.config</file>
                  <type>config</type>
                  <classifier>default-category-location</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-media.config</file>
                  <type>config</type>
                  <classifier>default-category-media</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-security.config</file>
                  <type>config</type>
                  <classifier>default-category-security</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-topic.config</file>
                  <type>config</type>
                  <classifier>default-category-topic</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-validation.config</file>
                  <type>config</type>
                  <classifier>default-category-validation</classifier>
                </artifact>
                <artifact>
                  <file>src/main/resources/default-category-version.config</file>
                  <type>config</type>
                  <classifier>default-category-version</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Import-Package>
              !org.abego.treelayout.*,
              *
            </Import-Package>
            <Export-Package>
              ddf.catalog.transformer.html,
              ddf.catalog.transformer.html.models
            </Export-Package>
            <Embed-Dependency>
              handlebars,
              commons-lang3,
              antlr4-runtime
            </Embed-Dependency>
            <Private-Package>
              ddf.catalog.data.impl.*
            </Private-Package>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>check-artifact-size</id>
            <phase>verify</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <ArtifactSizeEnforcerRule implementation="org.codice.maven.artifactsize.ArtifactSizeEnforcerRule">
                  <maxArtifactSize>1.3_MB</maxArtifactSize>
                </ArtifactSizeEnforcerRule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>default-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <haltOnFailure>true</haltOnFailure>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit implementation="org.codice.jacoco.LenientLimit">
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.76</minimum>
                    </limit>
                    <limit implementation="org.codice.jacoco.LenientLimit">
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.73</minimum>
                    </limit>
                    <limit implementation="org.codice.jacoco.LenientLimit">
                      <counter>COMPLEXITY</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.71</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
