<?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>
    <parent>
        <groupId>org.openrepose</groupId>
        <artifactId>filters-support</artifactId>
        <version>7.3.7.1</version>
    </parent>

    <name>Repose Components - Versioning</name>
    <artifactId>versioning</artifactId>
    <packaging>jar</packaging>

    <description>
        TODO
    </description>

    <properties>
        <sonar.jacoco.itReportPath>${project.basedir}/../../../target/jacoco-it.exec</sonar.jacoco.itReportPath>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>core-lib</artifactId>
        </dependency>

        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>core-service-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-runtime</artifactId>
        </dependency>

        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>health-check-service-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.openrepose</groupId>
            <artifactId>utilities</artifactId>
        </dependency>

        <dependency>
            <groupId>xmlunit</groupId>
            <artifactId>xmlunit</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>test</scope>
        </dependency>

        <!--Apache Pool Support-->
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
        </dependency>

        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.1</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <configuration>
                    <transformationSets>
                        <transformationSet>
                            <dir>src/main/resources/META-INF/schema/versioning</dir>
                            <stylesheet>src/main/resources/META-INF/schema/xsl/remove-1.1-elements.xsl</stylesheet>
                            <outputDir>${project.build.directory}/generated-resources/xml/xslt/versioning</outputDir>
                        </transformationSet>
                        <transformationSet>
                            <dir>src/main/resources/META-INF/schema/config</dir>
                            <stylesheet>src/main/resources/META-INF/schema/xsl/remove-1.1-elements.xsl</stylesheet>
                            <outputDir>${project.build.directory}/generated-resources/xml/xslt/config</outputDir>
                        </transformationSet>
                        <transformationSet>
                            <dir>src/main/resources/META-INF/schema/atom</dir>
                            <stylesheet>src/main/resources/META-INF/schema/xsl/remove-1.1-elements.xsl</stylesheet>
                            <outputDir>${project.build.directory}/generated-resources/xml/xslt/atom</outputDir>
                        </transformationSet>
                        <transformationSet>
                            <dir>src/main/resources/META-INF/schema/xml</dir>
                            <stylesheet>src/main/resources/META-INF/schema/xsl/remove-1.1-elements.xsl</stylesheet>
                            <outputDir>${project.build.directory}/generated-resources/xml/xslt/xml</outputDir>
                        </transformationSet>
                    </transformationSets>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>

                <configuration>

                    <specVersion>2.2</specVersion>
                    <schemaDirectory>${project.build.directory}/generated-resources/xml/xslt</schemaDirectory>

                    <schemaIncludes>
                        <include>**/*.xsd</include>
                    </schemaIncludes>
                    <bindingIncludes>
                        <include>**/*.xjb</include>
                    </bindingIncludes>

                    <strict>true</strict>
                    <verbose>false</verbose>

                </configuration>
            </plugin>
            <!-- this is working now that doxygen is commented out-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.codenarc</groupId>
                        <artifactId>CodeNarc</artifactId>
                        <version>0.21</version>
                        <exclusions>
                            <exclusion>
                                <groupId>ant</groupId>
                                <artifactId>ant</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.openrepose</groupId>
                        <artifactId>build-tools</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>codenarc</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <taskdef name="codenarc" classname="org.codenarc.ant.CodeNarcTask" classpathref="maven.plugin.classpath" />
                                <codenarc ruleSetFiles="classpath:repose-style-configs/ruleset.xml" maxPriority1Violations="0" maxPriority2Violations="0" maxPriority3Violations="0">
                                    <report type="xml">
                                        <option name="outputFile" value="${basedir}/target/CodeNarc.xml" />
                                        <option name="title" value="${project.name}" />
                                    </report>
                                    <!--fileset dir="${basedir}/src/test/groovy"-->
                                    <fileset dir="${basedir}/src/test/java">
                                        <include name="**/*.groovy" />
                                    </fileset>
                                </codenarc>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
