<?xml version="1.0" encoding="UTF-8"?>
<!--
~   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>org.basepom.inline</groupId>
        <artifactId>inline-root</artifactId>
        <version>1.0.1</version>
    </parent>

    <groupId>org.basepom.maven</groupId>
    <artifactId>inline-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <url>https://basepom.github.io/inline-maven-plugin/</url>

    <properties>
        <basepom.site.skip>false</basepom.site.skip>
        <maven.site.deploy.skip>true</maven.site.deploy.skip>
        <scm-publish.url>scm:git:https://github.com/basepom/basepom.github.io.git</scm-publish.url>
        <site-path>${project.artifactId}/development</site-path>

        <dep.maven-api.version>3.8.4</dep.maven-api.version>
        <dep.maven-resolver.version>1.6.3</dep.maven-resolver.version>
        <dep.plexus.version>2.1.1</dep.plexus.version>
        <dep.maven-shared-utils.version>3.3.4</dep.maven-shared-utils.version>
        <dep.plugin.plugin.version>3.6.2</dep.plugin.plugin.version>
        <dep.plugin.gmavenplus.plugin>1.13.1</dep.plugin.gmavenplus.plugin>
        <dep.groovy.version>3.0.9</dep.groovy.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.basepom.inline</groupId>
            <artifactId>transformer</artifactId>
        </dependency>

        <!-- Maven provided dependencies -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${dep.maven-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${dep.plugin.plugin.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${dep.maven-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${dep.maven-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${dep.maven-api.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-api</artifactId>
            <version>${dep.maven-resolver.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-component-annotations</artifactId>
            <version>${dep.plexus.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Maven APIs -->

        <dependency>
            <groupId>org.apache.maven.resolver</groupId>
            <artifactId>maven-resolver-util</artifactId>
            <version>${dep.maven-resolver.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-shared-utils</artifactId>
            <version>${dep.maven-shared-utils.version}</version>
        </dependency>

        <!-- other dependencies -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom2</artifactId>
            <version>2.0.6.1</version>
        </dependency>

        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.2.0</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Test code -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${dep.plugin.plugin.version}</version>
                    <configuration>
                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-component-metadata</artifactId>
                    <version>${dep.plexus.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>${dep.plugin.gmavenplus.plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-publish-plugin</artifactId>
                <executions>
                    <execution>
                        <id>publish-docs</id>
                        <phase>site-deploy</phase>
                        <goals>
                            <goal>publish-scm</goal>
                        </goals>
                        <configuration>
                            <serverId>github</serverId>
                            <pubScmUrl>${scm-publish.url}</pubScmUrl>
                            <scmBranch>main</scmBranch>
                            <checkoutDirectory>${java.io.tmpdir}/gh-pages-publish/${project.name}</checkoutDirectory>
                            <content>${project.build.directory}/site</content>
                            <subDirectory>${site-path}</subDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-component-metadata</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-metadata</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <excludeRoots combine.children="append">
                        <excludeRoot>target/generated-sources/plugin</excludeRoot>
                    </excludeRoots>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>addTestSources</goal>
                            <goal>compileTests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <configuration>
                    <!-- Allows access to the groovy utility class in the test source tree. -->
                    <addTestClassPath>true</addTestClassPath>
                </configuration>

                <!-- dependency for verify.groovy scripts -->
                <dependencies>
                    <dependency>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                        <version>${dep.guava.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy</artifactId>
                        <version>${dep.groovy.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-xml</artifactId>
                        <version>${dep.groovy.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Use Jacoco with the invoker plugin
                 for integration test coverage.
            -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-it</id>
                        <configuration>
                            <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                            <propertyName>invoker.mavenOpts</propertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.basepom.maven</groupId>
                <artifactId>duplicate-finder-maven-plugin</artifactId>
                <configuration>
                    <exceptions>
                        <!--
                            different parts of maven use different things to resolve dependencies.
                            Classworlds somehow sorts that out, but the duplicate finder does not know that.
                            So exclude this conflict.
                        -->
                        <exception>
                            <conflictingDependencies>
                                <dependency>
                                    <groupId>org.apache.maven.resolver</groupId>
                                    <artifactId>maven-resolver-util</artifactId>
                                </dependency>
                                <dependency>
                                    <groupId>org.eclipse.aether</groupId>
                                    <artifactId>aether-util</artifactId>
                                </dependency>
                            </conflictingDependencies>
                            <packages>
                                <package>org.eclipse.aether.util</package>
                            </packages>
                        </exception>
                    </exceptions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.1.1</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>summary</report>
                            <report>team</report>
                            <report>scm</report>
                            <report>issue-management</report>
                            <report>ci-management</report>
                            <report>dependency-info</report>
                            <report>dependencies</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>${dep.plugin.surefire.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report-only</report>
                            <report>failsafe-report-only</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${dep.plugin.jxr.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>pmd</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
    <profiles>
        <profile>
            <id>plugin-release</id>
            <properties>
                <site-path>${project.artifactId}/release-${project.version}</site-path>
            </properties>
        </profile>
    </profiles>
</project>
