<?xml version="1.0"?>
<!--

    Copyright 2005-2018 Dozer Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.github.dozermapper</groupId>
        <artifactId>dozer-parent</artifactId>
        <version>6.2.0</version>
        <relativePath>../</relativePath>
    </parent>

    <artifactId>dozer-plugins-parent</artifactId>
    <packaging>pom</packaging>
    <name>Dozer :: Plugins Parent</name>

    <properties>
        <!-- Maven Plugins versions; alphabetical order -->
        <alta-maven-plugin.version>0.6.1</alta-maven-plugin.version>
        <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
        <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
        <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.0.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
        <maven-surefire-report-plugin.version>2.20</maven-surefire-report-plugin.version>

        <!-- Apache Plugins; alphabetical order -->
        <cxf-xjc-plugin.version>3.2.1</cxf-xjc-plugin.version>

        <!-- Codehaus Plugins versions; alphabetical order -->
        <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
        <jaxb2-maven-plugin.version>1.6</jaxb2-maven-plugin.version>
        <xmlbeans-maven-plugin.version>2.3.3</xmlbeans-maven-plugin.version>

        <!-- GitHub Plugins versions; alphabetical order -->
        <spotbugs-maven-plugin.version>3.1.3</spotbugs-maven-plugin.version>

        <!-- OSGi Plugins versions; alphabetical order -->
        <maven-bundle-plugin.version>3.3.0</maven-bundle-plugin.version>
        <depends-maven-plugin.version>1.4.0</depends-maven-plugin.version>

        <!-- Protobuf Plugins versions; alphabetical order -->
        <protoc-jar-maven-plugin.version>3.3.0.1</protoc-jar-maven-plugin.version>
        <protoc.version>3.3.0</protoc.version>

        <!-- OSGI properties for bundle plugin -->
        <osgi.Bundle-Activator/>
        <osgi.defaults.Import-Package>
            !${osgi.Export-Package},
            org.osgi.framework;version="[1.7,2)";resolution:=optional
        </osgi.defaults.Import-Package>
        <osgi.additional.Import-Package/>
        <osgi.Import-Package>
            ${osgi.defaults.Import-Package},
            ${osgi.additional.Import-Package},
            *
        </osgi.Import-Package>
        <osgi.Export-Package/>
        <osgi.Require-Capability/>
        <osgi.Provide-Capability/>
        <osgi.SPI-Consumer/>
        <osgi.SPI-Provider/>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.github.dozermapper</groupId>
                <artifactId>dozer-bom-dependencies</artifactId>
                <version>${building-tools.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Core Testing -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <!-- Maven Plugins; alphabetical order -->
                <plugin>
                    <groupId>com.github.veithen.alta</groupId>
                    <artifactId>alta-maven-plugin</artifactId>
                    <version>${alta-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven-surefire-report-plugin.version}</version>
                </plugin>

                <!-- Apache Plugins; alphabetical order -->
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-xjc-plugin</artifactId>
                    <version>${cxf-xjc-plugin.version}</version>
                </plugin>

                <!-- Codehaus Plugins; alphabetical order -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxb2-maven-plugin</artifactId>
                    <version>${jaxb2-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xmlbeans-maven-plugin</artifactId>
                    <version>${xmlbeans-maven-plugin.version}</version>
                </plugin>

                <!-- GitHub Plugins; alphabetical order -->
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${spotbugs-maven-plugin.version}</version>
                </plugin>

                <!-- OSGi Plugins; alphabetical order -->
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven-bundle-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.servicemix.tooling</groupId>
                    <artifactId>depends-maven-plugin</artifactId>
                    <version>${depends-maven-plugin.version}</version>
                </plugin>

                <!-- Protobuf Plugins; alphabetical order -->
                <plugin>
                    <groupId>com.github.os72</groupId>
                    <artifactId>protoc-jar-maven-plugin</artifactId>
                    <version>${protoc-jar-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Core Java Plugins; alphabetical order -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${project.java.version}</source>
                    <target>${project.java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <compilerArgs>
                        <compilerArg>-Xdiags:verbose</compilerArg>
                        <compilerArg>-Xlint:all</compilerArg>
                        <compilerArg>-Xlint:-processing</compilerArg>
                        <!--<compilerArg>-Werror</compilerArg>-->
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <excludePackageNames>org.dozer.vo.jaxb.employee:com.github.dozermapper.protobuf.vo.proto</excludePackageNames>
                    <failOnError>true</failOnError>
                    <additionalparam>-Xdoclint:all</additionalparam>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Testing Plugins; alphabetical order -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testClassesDirectory>target/test-classes</testClassesDirectory>
                    <excludes>
                        <exclude>**/Test*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!-- OSGi Plugins; alphabetical order -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <unpackBundle>false</unpackBundle>
                    <instructions>
                        <Bundle-Activator>${osgi.Bundle-Activator}</Bundle-Activator>
                        <Bundle-Name>${project.name}</Bundle-Name>
                        <Bundle-DocURL>https://dozermapper.github.io/gitbook/</Bundle-DocURL>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <DynamicImport-Package>*</DynamicImport-Package>
                        <Export-Package>${osgi.Export-Package};version=${project.version}</Export-Package>
                        <Import-Package>${osgi.Import-Package}</Import-Package>
                        <Implementation-Title>${project.name}</Implementation-Title>
                        <Implementation-Version>${project.version}</Implementation-Version>
                        <Karaf-Info>${project.groupId}.${project.artifactId}=${project.version}</Karaf-Info>
                        <Require-Capability>${osgi.Require-Capability}</Require-Capability>
                        <Provide-Capability>${osgi.Provide-Capability}</Provide-Capability>
                        <SPI-Consumer>${osgi.SPI-Consumer}</SPI-Consumer>
                        <SPI-Provider>${osgi.SPI-Provider}</SPI-Provider>
                    </instructions>
                </configuration>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Governance Plugins; alphabetical order -->
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.github.dozermapper</groupId>
                        <artifactId>dozer-building-tools</artifactId>
                        <version>${building-tools.version}</version>
                        <scope>compile</scope>
                    </dependency>
                </dependencies>
                <configuration>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <xmlOutput>true</xmlOutput>
                    <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.github.dozermapper</groupId>
                        <artifactId>dozer-building-tools</artifactId>
                        <version>${building-tools.version}</version>
                        <scope>compile</scope>
                    </dependency>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.0</version>
                        <scope>compile</scope>
                    </dependency>
                    <dependency>
                        <groupId>com.github.sevntu-checkstyle</groupId>
                        <artifactId>sevntu-checkstyle-maven-plugin</artifactId>
                        <version>1.24.2</version>
                        <scope>compile</scope>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>strict-checkstyle.xml</configLocation>
                            <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
                            <consoleOutput>true</consoleOutput>
                            <failOnViolation>true</failOnViolation>
                            <failsOnError>true</failsOnError>
                            <encoding>UTF-8</encoding>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>
