<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.camel.quarkus</groupId>
        <artifactId>camel-quarkus-poms</artifactId>
        <version>3.17.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>camel-quarkus-build-parent</artifactId>
    <packaging>pom</packaging>

    <name>Camel Quarkus :: Build Parent</name>
    <description>Maven plugins configuration</description>

    <properties>
        <!-- maven-surefire-plugin -->
        <failIfNoTests>false</failIfNoTests>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.transformer</groupId>
                <artifactId>org.eclipse.transformer</artifactId>
                <version>${eclipse-transformer.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-extension-maven-plugin</artifactId>
                    <version>${quarkus.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>extension-descriptor</goal>
                            </goals>
                            <phase>compile</phase>
                            <configuration>
                                <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}
                                </deployment>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.camel.quarkus</groupId>
                    <artifactId>camel-quarkus-maven-plugin</artifactId>
                    <version>${project.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <quiet>true</quiet>
                        <doclint>none</doclint>
                        <show>package</show>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jboss.jandex</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>${jandex-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter-maven-plugin.version}</version>
                    <configuration>
                        <configFile>${maven.multiModuleProjectDirectory}/tooling/eclipse-formatter-config.xml</configFile>
                        <lineEnding>LF</lineEnding>
                        <skip>${format.skip}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>${impsort-maven-plugin.version}</version>
                    <configuration>
                        <groups>java.,javax.,org.w3c.,org.xml.,junit.</groups>
                        <removeUnused>true</removeUnused>
                        <staticAfter>true</staticAfter>
                        <staticGroups>java.,javax.,org.w3c.,org.xml.,junit.</staticGroups>
                        <skip>${format.skip}</skip>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>process-resource-bundles</id>
                        <phase>none</phase><!-- skip to save time -->
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>legal-resources</id>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${maven.multiModuleProjectDirectory}/tooling/legal</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Sanity checks and formatting are disabled when building with '-Dquickly' -->
            <id>full</id>
            <activation>
                <property>
                    <name>!quickly</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format</id>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                                <phase>process-sources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <goals>
                                    <goal>sort</goal>
                                </goals>
                                <phase>process-sources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.gmavenplus</groupId>
                        <artifactId>gmavenplus-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sanity-checks</id>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <scripts>
                                        <script>file:${maven.multiModuleProjectDirectory}/tooling/scripts/sanity-checks.groovy</script>
                                    </scripts>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-test</id>
                                <phase>test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>check-format</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format</id>
                                <phase />
                            </execution>
                            <execution>
                                <id>validate</id>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                                <phase>validate</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <phase />
                            </execution>
                            <execution>
                                <id>check-imports</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <phase>validate</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.gmavenplus</groupId>
                        <artifactId>gmavenplus-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sanity-checks</id>
                                <phase /><!-- Speedup the check-format profile by skipping the sanity-checks  -->
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>apache-release</id>
            <activation>
                <property>
                    <name>apache-release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.gmavenplus</groupId>
                        <artifactId>gmavenplus-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sanity-checks</id>
                                <phase /><!-- Speedup the releases by skipping the sanity-checks  -->
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
