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

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>41</version>
        <relativePath>./oss</relativePath>
    </parent>

    <artifactId>build-basepom-root</artifactId>
    <packaging>pom</packaging>
    <description>
        All the base poms in the world.

        Glue to build the various flavors of the basepom.
    </description>
    <url>https://github.com/basepom/basepom/</url>
    <name>basepom-build</name>

    <inceptionYear>2013</inceptionYear>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>hgschmie</id>
            <name>Henning Schmiedehausen</name>
            <email>henning@schmiedehausen.org</email>
            <timezone>-8</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/basepom/basepom.git</connection>
        <developerConnection>scm:git:git@github.com:basepom/basepom.git</developerConnection>
        <url>https://github.com/basepom/basepom</url>
        <tag>basepom-41</tag>
    </scm>

    <properties>
        <project.build.targetJdk>11</project.build.targetJdk>

        <basepom.maven.version>3.5.0</basepom.maven.version>
        <basepom.check.skip-all>true</basepom.check.skip-all>
        <basepom.check.skip-enforcer>false</basepom.check.skip-enforcer>
        <basepom.check.skip-license>false</basepom.check.skip-license>
        <basepom.release.tag-name-format>basepom-@{project.version}</basepom.release.tag-name-format>
        <basepom.release.profiles>release,oss-release</basepom.release.profiles>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <arguments>-N</arguments>
                        <tagNameFormat>basepom-@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <configuration>
                        <!-- for deploy-file -->
                        <groupId>${project.groupId}</groupId>
                        <generatePom>false</generatePom>
                        <packaging>pom</packaging>
                        <version>${project.version}</version>
                        <repositoryId>sonatype-nexus-snapshots</repositoryId>
                        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <configuration>
                        <!-- for install-file -->
                        <groupId>${project.groupId}</groupId>
                        <generatePom>false</generatePom>
                        <createChecksum>true</createChecksum>
                        <packaging>pom</packaging>
                        <version>${project.version}</version>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <executions>
                    <execution>
                        <id>foundation</id>
                        <phase>install</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                        <configuration>
                            <artifactId>basepom-foundation</artifactId>
                            <file>${basedir}/foundation/pom.xml</file>
                        </configuration>
                    </execution>
                    <execution>
                        <id>minimal</id>
                        <phase>install</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                        <configuration>
                            <artifactId>basepom-minimal</artifactId>
                            <file>${basedir}/minimal/pom.xml</file>
                        </configuration>
                    </execution>
                    <execution>
                        <id>oss</id>
                        <phase>install</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                        <configuration>
                            <artifactId>basepom-oss</artifactId>
                            <file>${basedir}/oss/pom.xml</file>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- This must be in a default-activated profile so that when doing -->
        <!-- a release, this profile gets implicitly deactivated (and the   -->
        <!-- normal release process is used).                               -->
        <profile>
            <id>basepom.snapshot-deploy</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>foundation</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>basepom-foundation</artifactId>
                                    <file>${basedir}/foundation/pom.xml</file>
                                </configuration>
                            </execution>
                            <execution>
                                <id>minimal</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>basepom-minimal</artifactId>
                                    <file>${basedir}/minimal/pom.xml</file>
                                </configuration>
                            </execution>
                            <execution>
                                <id>oss</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>basepom-oss</artifactId>
                                    <file>${basedir}/oss/pom.xml</file>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <modules>
                <module>foundation</module>
                <module>minimal</module>
                <module>oss</module>
            </modules>
        </profile>
        <profile>
            <id>oss-release</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <!-- Sign artifacts using gpg for oss upload -->
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-gpg-plugin</artifactId>
                            <configuration>
                                <!-- sign-and-deploy-file -->
                                <groupId>${project.groupId}</groupId>
                                <generatePom>false</generatePom>
                                <packaging>pom</packaging>
                                <version>${project.version}</version>
                                <repositoryId>sonatype-nexus-staging</repositoryId>
                                <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                                <updateReleaseInfo>true</updateReleaseInfo>
                                <!-- sign-and-deploy-file -->
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>foundation</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>sign-and-deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>basepom-foundation</artifactId>
                                    <file>${basedir}/foundation/pom.xml</file>
                                </configuration>
                            </execution>
                            <execution>
                                <id>minimal</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>sign-and-deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>basepom-minimal</artifactId>
                                    <file>${basedir}/minimal/pom.xml</file>
                                </configuration>
                            </execution>
                            <execution>
                                <id>oss</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>sign-and-deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>basepom-oss</artifactId>
                                    <file>${basedir}/oss/pom.xml</file>
                                </configuration>
                            </execution>
                            <execution>
                                <id>build-root</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>sign-and-deploy-file</goal>
                                </goals>
                                <configuration>
                                    <artifactId>build-basepom-root</artifactId>
                                    <file>${basedir}/pom.xml</file>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
