<?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>com.buschmais.jqassistant</groupId>
        <artifactId>jqa-uber-parent</artifactId>
        <version>1.2.0</version>
    </parent>

    <groupId>com.buschmais.jqassistant</groupId>
    <artifactId>jqassistant.plugin.plugin-parent</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>

    <name>jQAssistant Plugin Parent POM</name>
    <url>http://jqassistant.org/</url>
    <inceptionYear>2016</inceptionYear>

    <organization>
        <name>buschmais GbR</name>
        <url>http://www.buschmais.com</url>
    </organization>

    <licenses>
        <license>
            <name>GNU General Public License, v3</name>
            <url>http://www.gnu.org/licenses/gpl-3.0.html</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:buschmais/jqa-plugin-parent.git</connection>
        <developerConnection>scm:git:git@github.com:buschmais/jqa-plugin-parent.git</developerConnection>
        <url>https://github.com/buschmais/jqa-plugin-parent</url>
      <tag>1.2.0</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>
        <jqa-asciidoctor-utilities.version>1.2.0</jqa-asciidoctor-utilities.version>
        <jqa.core-framework.version>1.2.0</jqa.core-framework.version>
        <jqa.own-constraints.version>1.2.0</jqa.own-constraints.version>
        <org.codehaus.groovy.version>2.4.0</org.codehaus.groovy.version>
        <org.jruby.version>9.0.5.0</org.jruby.version>
        <org.mockito.version>1.9.5</org.mockito.version>
        <org.slf4j.version>1.7.13</org.slf4j.version>
        <junit.version>4.12</junit.version>
    </properties>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.buschmais.jqassistant</groupId>
                    <artifactId>jqassistant-maven-plugin</artifactId>
                    <configuration>
                        <scanIncludes>
                            <scanInclude>
                                <path>${project.basedir}</path>
                            </scanInclude>
                        </scanIncludes>
                        <groups>
                            <group>jqa-legal</group>
                            <group>jqa-maven-constraints</group>
                            <group>jqa-project-layout</group>
                        </groups>
                    </configuration>
                    <dependencies>
                        <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>
                    </dependencies>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <quiet>true</quiet>
                        <detectLinks>false</detectLinks>
                        <detectOfflineLinks>false</detectOfflineLinks>
                        <additionalparam>-Xdoclint:none</additionalparam>
                        <groups>
                            <group>
                                <!--<title>API</title>-->
                                <title>Public API</title>
                                <packages>com.buschmais.jqassistant.plugin.${project.artifactId}.api*</packages>
                            </group>
                        </groups>

                        <source>1.7</source>
                        <doclet>org.asciidoctor.Asciidoclet</doclet>
                        <docletArtifact>
                            <groupId>org.asciidoctor</groupId>
                            <artifactId>asciidoclet</artifactId>
                            <version>1.5.4</version>
                        </docletArtifact>
                        <!--<overview>src/main/java/overview.adoc</overview>-->
                        <additionalparam>
                            --base-dir ${project.basedir}
                        </additionalparam>

                    </configuration>
                </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>copy-asciidoc-stylesheets</id>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <outputDirectory>${project.build.directory}/xml2asciidoc</outputDirectory>
                            <includeTypes>xsl</includeTypes>
                            <includeClassifiers>rules2asciidoc-v2,plugin2asciidoc</includeClassifiers>
                            <stripVersion>true</stripVersion>
                        </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>none</phase>-->
                        <phase>process-sources</phase>
                        <configuration>
                            <transformationSets>
                                <transformationSet>
                                    <dir>src/main/resources/META-INF</dir>
                                    <includes>
                                        <include>jqassistant-plugin.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/asciidoctor-utilities-plugin2asciidoc.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>artifactId</name>
                                            <value>${project.artifactId}</value>
                                        </parameter>
                                    </parameters>
                                </transformationSet>
                                <transformationSet>
                                    <dir>src/main/resources/META-INF/</dir>
                                    <includes>
                                        <include>jqassistant-plugin.xml</include>
                                    </includes>
                                    <stylesheet>
                                        ${project.build.directory}/xml2asciidoc/asciidoctor-utilities-rules2asciidoc-v2.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>concepts-and-constraints.adoc</replacement>
                                        </fileMapper>
                                    </fileMappers>
                                    <parameters>
                                        <parameter>
                                            <name>dirOfRules</name>
                                            <value>${project.basedir}/src/main/resources/META-INF/jqassistant-rules
                                            </value>
                                        </parameter>
                                    </parameters>
                                </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-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- Builds a jar with the Asciidoctor based documenation
                 !   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.core</groupId>
                <artifactId>scanner</artifactId>
                <version>${jqa.core-framework.version}</version>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>common</artifactId>
                <version>${jqa.core-framework.version}</version>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>report</artifactId>
                <version>${jqa.core-framework.version}</version>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>plugin</artifactId>
                <version>${jqa.core-framework.version}</version>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>store</artifactId>
                <version>${jqa.core-framework.version}</version>
            </dependency>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>shared</artifactId>
                <version>${jqa.core-framework.version}</version>
            </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>

            <dependency>
                <groupId>com.buschmais.jqassistant.core</groupId>
                <artifactId>analysis</artifactId>
                <version>${jqa.core-framework.version}</version>
            </dependency>


            <!-- - - - - - - - - - - - - - - - - - - - - - - - - - -->


            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>


            <dependency>
                <!-- todo Why do we need Groovy here? -->
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-jsr223</artifactId>
                <version>${org.codehaus.groovy.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>java-hamcrest</artifactId>
                <version>2.0.0.0</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <!-- Why do we need JRuby here? -->
                <groupId>org.jruby</groupId>
                <artifactId>jruby-core</artifactId>
                <version>${org.jruby.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${org.mockito.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${org.slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.buschmais.jqassistant</groupId>
            <artifactId>asciidoctor-utilities</artifactId>
            <type>xsl</type>
            <classifier>plugin2asciidoc</classifier>
            <version>${jqa-asciidoctor-utilities.version}</version>
        </dependency>
        <dependency>
            <groupId>com.buschmais.jqassistant</groupId>
            <artifactId>asciidoctor-utilities</artifactId>
            <type>xsl</type>
            <classifier>rules2asciidoc-v2</classifier>
            <version>${jqa-asciidoctor-utilities.version}</version>
        </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>
