<?xml version="1.0"?>
<!--
	Copyright 2020 Adobe. All rights reserved.
	This file is licensed 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 REPRESENTATIONS
	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>

    <!-- the ASF parent is used to trigger the right release profile -->
    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>23</version>
        <relativePath />
    </parent>

    <groupId>com.adobe.dx</groupId>
    <artifactId>parent-reactor</artifactId>
    <version>16</version>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.prefix>Adobe DX</project.prefix>
        <maven.deploy.skip>false</maven.deploy.skip>
        <frontend-maven-plugin.version>1.7.6</frontend-maven-plugin.version>
    </properties>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Adobe Web Platform team</name>
            <email>grp-dexter-tech@adobe.com</email>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:git:https://github.com/adobe/adobe-dx.git</connection>
        <developerConnection>scm:git:git@github.com:adobe/adobe-dx.git</developerConnection>
        <url>https://github.com/adobe/adobe-dx/parent/tree/master</url>
        <tag>parent-reactor-16</tag>
    </scm>

    <name>${project.prefix} - Parent reactor</name>

    <modules>
        <module>repository-structure</module>
        <module>main</module>
        <module>node-main</module>
    </modules>

    <!-- ======================================================================= -->
    <!-- B U I L D                                                               -->
    <!-- ======================================================================= -->
    <build>
        <!-- allows shorthand "mvn" to run a normal "mvn clean install" build -->
        <defaultGoal>clean install</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.7</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        <skipNexusStagingDeployMojo>${maven.deploy.skip}</skipNexusStagingDeployMojo>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>deploy</phase>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>0.13</version>
                    <configuration>
                        <excludes combine.children="append">
                            <!--  Used by maven-remote-resources-plugin -->
                            <exclude>**/src/main/appended-resources/META-INF/*</exclude>
                            <!--  Generated by maven-remote-resources-plugin -->
                            <exclude>velocity.log</exclude>
                            <!-- don't check anything in target -->
                            <exclude>**/target/**</exclude>
                            <!-- don't check anything in js dist files -->
                            <exclude>**/*.min.*</exclude>
                            <!-- README files in markdown format -->
                            <exclude>**/README.md</exclude>
                            <exclude>CODE_OF_CONDUCT.md</exclude>
                            <exclude>CONTRIBUTING.md</exclude>
                            <exclude>VERSIONS.md</exclude>
                            <!-- Ignore files generated by IDE plugins e.g. maven-eclipse-plugin -->
                            <exclude>maven-eclipse.xml</exclude>
                            <!-- Ignore VLT .content.xml files + dialog configurations -->
                            <exclude>**/jcr_root/**/*.xml</exclude>
                            <!-- Ignore auto-generated VLT file -->
                            <exclude>**/META-INF/vault/settings.xml</exclude>
                            <!-- Ignore .vltignore files -->
                            <exclude>**/.vltignore</exclude>
                            <!-- Ignore .vlt files -->
                            <exclude>**/.vlt</exclude>
                            <!-- Ignore .config files -->
                            <exclude>**/*.config</exclude>
                            <!-- Ignore .svg files -->
                            <exclude>**/*.svg</exclude>
                            <!-- Exclude all JSON files -->
                            <exclude>**/*.json</exclude>
                            <!-- Exclude some . files -->
                            <exclude>**/.project</exclude>
                            <exclude>**/.classpath</exclude>
                            <exclude>**/.settings/**</exclude>
                            <!-- Generated for release source archives -->
                            <exclude>DEPENDENCIES</exclude>
                            <!-- .rej files from svn/patch -->
                            <exclude>**/*.rej</exclude>
                            <!-- Jenkins build pipeline configuration file -->
                            <exclude>Jenkinsfile</exclude>
                            <exclude>jenkinsfiles/**/*</exclude>
                            <!-- Ignore IDEA files -->
                            <exclude>**/*.iml</exclude>
                            <!-- Ignore lint-files -->
                            <exclude>**/*.eslintrc</exclude>
                            <exclude>**/*.editorconfig</exclude>
                            <exclude>**/*.stylelintrc.yaml</exclude>
                            <exclude>**/*.eslintignore</exclude>
                            <!-- Ignore Node and npm -->
                            <exclude>**/node/**</exclude>
                            <exclude>**/node_modules/**</exclude>
                            <!-- Ignore github templates -->
                            <exclude>**/.github/**</exclude>
                            <!-- Ignore babelrc -->
                            <exclude>.babelrc</exclude>
                            <!-- Ignore js test and coverage reports -->
                            <exclude>**/js_reports/**</exclude>
                            <!-- Ignore mockito extensions config -->
                            <exclude>**/test/resources/mockito-extensions/*</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>dx-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>animal-sniffer-maven-plugin</artifactId>
                        <version>1.18</version>
                        <configuration>
                            <signature>
                                <groupId>org.codehaus.mojo.signature</groupId>
                                <artifactId>java18</artifactId>
                                <version>1.0</version>
                            </signature>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                            <gpgArguments>
                                <arg>--digest-algo=SHA512</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>3.0.0-M1</version>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>3.0.0-M1</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.release</groupId>
                                <artifactId>maven-release-oddeven-policy</artifactId>
                                <version>3.0.0-M1</version>
                            </dependency>
                            <dependency>
                                <groupId>org.eclipse.aether</groupId>
                                <artifactId>aether-util</artifactId>
                                <version>1.0.0.v20140518</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <scmCommentPrefix>@releng [maven-scm] :</scmCommentPrefix>
                            <preparationGoals>clean install</preparationGoals>
                            <goals>deploy</goals>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>dx-release</releaseProfiles>
                            <projectVersionPolicyId>OddEvenVersionPolicy</projectVersionPolicyId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
