<?xml version="1.0" encoding="UTF-8"?>
<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>

    <groupId>com.mulesoft.documentation.builder</groupId>
    <artifactId>mule-docs-builder-parent</artifactId>
    <version>1.0.5</version>
    <packaging>pom</packaging>

    <name>MuleSoft Documentation Builder Parent</name>
    <description>This is the parent project for libraries used to build the MuleSoft Documentation website.</description>
    <url>https://docs.mulesoft.com</url>

    <organization>
        <name>MuleSoft, Inc.</name>
        <url>https://www.mulesoft.com</url>
    </organization>

    <developers>
        <developer>
            <id>seanosterberg</id>
            <name>Sean Osterberg</name>
            <email>sean.osterberg@mulesoft.com</email>
            <roles>
                <role>Project Manager</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>CPAL v1.0</name>
            <url>http://www.mulesoft.com/CPAL</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/mulesoft-labs/mule-docs-builder.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft-labs/mule-docs-builder.git</developerConnection>
        <url>https://github.com/mulesoft-labs/mule-docs-builder</url>
        <tag>v1.0.5</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.8</jdk.version>
        <executor.args />
        <dist.serverId>mule-releases</dist.serverId>
        <dist.serverName>Mule Releases Repository</dist.serverName>
        <dist.nexusUrl>https://repository-master.mulesoft.org/nexus/</dist.nexusUrl>
        <dist.nexusStagingProfileId>releases</dist.nexusStagingProfileId>
        <!--
        <dist.serverId>central-releases-repository</dist.serverId>
        <dist.serverName>Central Releases Repository</dist.serverName>
        <dist.nexusUrl>https://oss.sonatype.org/</dist.nexusUrl>
        <dist.nexusStagingProfileId />
        -->
    </properties>

    <modules>
        <module>mule-docs-builder</module>
        <module>mule-docs-single-page-builder</module>
        <!--
        <module>mule-docs-sitemap-generator</module>
        <module>mule-docs-link-manager</module>
        -->
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.4</version>
                    <configuration>
                        <additionalparam>-Xdoclint:none</additionalparam>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <useReleaseProfile>false</useReleaseProfile>
                        <!-- During release:perform, enable the "release" profile -->
                        <arguments>${executor.args}</arguments>
                        <releaseProfiles>release</releaseProfiles>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!--
        Commands to perform full release from CI:

        $ mvn -B -Prelease -DscmCommentPrefix= release:prepare
        $ mvn -Prelease release:perform
        -->
        <profile>
            <id>release</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <defaultGoal>deploy</defaultGoal>
                <plugins>
                    <!--
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    -->
                    <plugin>
                      <artifactId>maven-javadoc-plugin</artifactId>
                      <executions>
                          <execution>
                              <id>attach-javadocs</id>
                              <goals>
                                  <goal>jar</goal>
                              </goals>
                          </execution>
                      </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <!-- Only used by the native Maven deploy plugin, not the Nexus deploy plugin -->
        <repository>
            <id>${dist.serverId}</id>
            <name>${dist.serverName}</name>
            <!--
            <url>${dist.nexusUrl}service/local/staging/deploy/maven2</url>
            -->
            <!-- Use the following url to skip staging and upload artifacts directly -->
            <url>${dist.nexusUrl}content/repositories/${dist.nexusStagingProfileId}</url>
        </repository>
    </distributionManagement>
</project>
