<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>com.buschmais.jqassistant</groupId>
        <artifactId>jqa-uber-parent</artifactId>
        <version>2.0.1</version>
        <relativePath/>
    </parent>

    <groupId>com.buschmais.jqassistant.plugin</groupId>
    <artifactId>parent</artifactId>
    <version>2.0.1</version>
    <packaging>pom</packaging>

    <name>jQAssistant Plugin Parent POM</name>
    <url>https://jqassistant.org/</url>
    <inceptionYear>2016</inceptionYear>

    <organization>
        <name>jQAssistant Development Team</name>
        <url>https://jqassistant.org</url>
    </organization>

    <licenses>
        <license>
            <name>GNU General Public License, v3</name>
            <url>https://www.gnu.org/licenses/gpl-3.0.html</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:jqassistant/jqa-plugin-parent.git</connection>
        <developerConnection>scm:git:git@github.com:jqassistant/jqa-plugin-parent.git</developerConnection>
        <url>https://github.com/jqassistant/jqa-plugin-parent</url>
      <tag>HEAD</tag>
  </scm>

    <description>
        The parent POM for all plugins developed by the jQAssistant team. It defines a standard
        of actions, checks and dependencies required by each jQAssistant plugin.
    </description>

    <properties>
        <checkstyle.version>8.29</checkstyle.version>
        <jqa-asciidoctor-utilities.version>2.0.1</jqa-asciidoctor-utilities.version>
        <jqa-bom.version>2.0.1</jqa-bom.version>
        <jqa-core-framework.version>2.0.1</jqa-core-framework.version>
        <jqa-neo4jbackend.version>2.0.1</jqa-neo4jbackend.version>
        <jqa-own-constraints.version>2.0.1</jqa-own-constraints.version>
        <mockito.version>3.3.3</mockito.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.buschmais.jqassistant</groupId>
                    <artifactId>jqassistant-maven-plugin</artifactId>
                    <configuration>
                        <!--
                         ! To not configure failOnSeverity and warnOnSeverity
                         ! directly. Please control these parameters via
                         ! the user properties set in the properties section
                         ! of the Ueber Parant of jQAssistant.
                         ! Oliver B. Fischer, 2017-06-07
                         !-->
                        <scanProperties>
                            <xml.file.include>/META-INF/jqassistant-plugin.xml</xml.file.include>
                        </scanProperties>
                        <groups>
                            <group>jqa-legal</group>
                            <group>jqa-maven-constraints</group>
                            <group>jqa-maven-dependency-constraints</group>
                            <group>jqa-project-layout</group>
                            <group>jqa-plugin:Default</group>
                        </groups>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.buschmais.jqassistant</groupId>
                            <artifactId>github-integration</artifactId>
                            <version>${jqa-own-constraints.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.buschmais.jqassistant</groupId>
                            <artifactId>legal-constraints</artifactId>
                            <version>${jqa-own-constraints.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.buschmais.jqassistant</groupId>
                            <artifactId>maven-commmon-constraints</artifactId>
                            <version>${jqa-own-constraints.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.buschmais.jqassistant</groupId>
                            <artifactId>project-layout-constraints</artifactId>
                            <version>${jqa-own-constraints.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.buschmais.jqassistant</groupId>
                            <artifactId>plugin-rules</artifactId>
                            <version>${jqa-own-constraints.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.buschmais.jqassistant</groupId>
                <artifactId>jqassistant-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- Copies the XSL stylesheets to a subdirectory of the
                 !   the build directory. They are needed to process the XML
                 !   descriptors of jQAssistant during the generation of the
                 !   documentation.
                 !-->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-asciidoc-stylesheets</id>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <outputDirectory>${project.build.directory}/xml2asciidoc</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.buschmais.jqassistant</groupId>
                                    <artifactId>asciidoctor-utilities</artifactId>
                                    <type>zip</type>
                                    <classifier>xsl</classifier>
                                    <version>${jqa-asciidoctor-utilities.version}</version>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xml-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>transform-xml2asciidoc</id>
                        <goals>
                            <goal>transform</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <transformationSets>
                                <!-- Plugin -->
                                <transformationSet>
                                    <dir>src/main/resources/META-INF</dir>
                                    <includes>
                                        <include>jqassistant-plugin.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/plugin.xsl
                                    </stylesheet>
                                    <outputDir>${project.build.directory}/generated-sources/asciidoc</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
                                            <pattern>^jqassistant-plugin\.xml$</pattern>
                                            <replacement>plugin.adoc</replacement>
                                        </fileMapper>
                                    </fileMappers>
                                    <parameters>
                                        <parameter>
                                            <name>groupId</name>
                                            <value>${project.groupId}</value>
                                        </parameter>
                                        <parameter>
                                            <name>artifactId</name>
                                            <value>${project.artifactId}</value>
                                        </parameter>
                                    </parameters>
                                </transformationSet>
                                <!-- Rules -->
                                <transformationSet>
                                    <dir>src/main/resources/META-INF</dir>
                                    <includes>
                                        <include>jqassistant-rules/*.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/rules.xsl
                                    </stylesheet>
                                    <outputDir>${project.build.directory}/generated-sources/asciidoc</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
                                            <pattern>^(.*)$</pattern>
                                            <replacement>$1.adoc</replacement>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                                <!-- Group Summary -->
                                <transformationSet>
                                    <dir>src/main/resources/META-INF</dir>
                                    <includes>
                                        <include>jqassistant-rules/*.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/group-summary.xsl
                                    </stylesheet>
                                    <outputDir>${project.build.directory}/generated-sources/asciidoc</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
                                            <pattern>^(.*)$</pattern>
                                            <replacement>$1-group-summary.adoc</replacement>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                                <!-- Constraint Summary -->
                                <transformationSet>
                                    <dir>src/main/resources/META-INF</dir>
                                    <includes>
                                        <include>jqassistant-rules/*.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/constraint-summary.xsl
                                    </stylesheet>
                                    <outputDir>${project.build.directory}/generated-sources/asciidoc</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
                                            <pattern>^(.*)$</pattern>
                                            <replacement>$1-constraint-summary.adoc</replacement>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                                <!-- Concept Summary -->
                                <transformationSet>
                                    <dir>src/main/resources/META-INF</dir>
                                    <includes>
                                        <include>jqassistant-rules/*.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/concept-summary.xsl
                                    </stylesheet>
                                    <outputDir>${project.build.directory}/generated-sources/asciidoc</outputDir>
                                    <fileMappers>
                                        <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
                                            <pattern>^(.*)$</pattern>
                                            <replacement>$1-concept-summary.adoc</replacement>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>net.sf.saxon</groupId>
                        <artifactId>saxon</artifactId>
                        <version>8.7</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <configLocation>/checkstyle/jqa-code-style.xml</configLocation>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.buschmais.jqassistant</groupId>
                        <artifactId>checkstyle-config</artifactId>
                        <version>${project.parent.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <!-- Builds a jar with the Asciidoctor based documentation
                 !   of the plugin and all needed stuff. This artifact
                 !   is required for building the user manual of jQAssistant.
                 !-->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>

                <dependencies>
                    <dependency>
                        <groupId>com.buschmais.jqassistant</groupId>
                        <artifactId>asciidoctor-utilities</artifactId>
                        <version>${jqa-asciidoctor-utilities.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>attach-asciidoc</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptorRefs>
                                <descriptorRef>asciidoc</descriptorRef>
                            </descriptorRefs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


    <dependencyManagement>
        <dependencies>
            <!--
             ! Here goes all dependencies to the core framework
             ! Please keep in mind that the version of the plugin parent
             ! MUST match the version of core framework of jQAssistant!
             !-->

            <dependency>
                <groupId>com.buschmais.jqassistant</groupId>
                <artifactId>bom</artifactId>
                <version>${jqa-bom.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>scanner</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>report</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>store</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>shared</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>rule</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>analysis</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>test</artifactId>
                <version>${jqa-core-framework.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.xo</groupId>
                <artifactId>xo.api</artifactId>
                <version>${com.buschmais.xo.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.xo</groupId>
                <artifactId>xo.spi</artifactId>
                <version>${com.buschmais.xo.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.xo</groupId>
                <artifactId>xo.neo4.api</artifactId>
                <version>${com.buschmais.xo.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>shared</artifactId>
                <type>test-jar</type>
                <version>${jqa-core-framework.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>store</artifactId>
                <version>${jqa-core-framework.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>analysis</artifactId>
                <version>${jqa-core-framework.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.buschmais.jqassistant</groupId>
            <artifactId>asciidoctor-utilities</artifactId>
            <type>zip</type>
            <classifier>xsl</classifier>
            <version>${jqa-asciidoctor-utilities.version}</version>
            <!-- The scope must be provided otherwise it will be part of the distribution -->
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

</project>