<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>org.kaazing</groupId>
    <artifactId>community.parent</artifactId>
    <packaging>pom</packaging>
    <version>2.18</version>

    <name>Community Parent</name>
    <url>https://github.com/kaazing/community</url>
    <description>Community parent POM for all Maven projects</description>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <inceptionYear>2014</inceptionYear>

    <properties>
        <checkstyle.config.location>org/kaazing/code/quality/checkstyle.xml</checkstyle.config.location>
        <checkstyle.suppressions.location>org/kaazing/code/quality/checkstyle-suppressions.xml</checkstyle.suppressions.location>
        <checkstyle.plugin.version>2.13</checkstyle.plugin.version>
        <code.quality.version>1.4</code.quality.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <source.plugin.version>2.4</source.plugin.version>
        <failsafe.plugin.version>2.18.1</failsafe.plugin.version>
        <javadoc.plugin.version>2.10.1</javadoc.plugin.version>
        <gpg.plugin.version>1.6</gpg.plugin.version>
        <nexus.staging.plugin.version>1.6.2</nexus.staging.plugin.version>
        <enforcer.plugin.version>1.3.1</enforcer.plugin.version>
        <require.java.version>1.5.0+</require.java.version>
        <versions.maven.plugin.version>2.1</versions.maven.plugin.version>
        <animal.sniffer.version>1.14</animal.sniffer.version>
        <animal.sniffer.plugin.version>${animal.sniffer.version}</animal.sniffer.plugin.version>
        <animal.sniffer.signature.groupId>org.kaazing.mojo.signature</animal.sniffer.signature.groupId>
        <animal.sniffer.signature.artifactId>java18</animal.sniffer.signature.artifactId>
        <animal.sniffer.signature.version>1.0</animal.sniffer.signature.version>
        <animal.sniffer.skip>false</animal.sniffer.skip>
        <lifecycle.mapping.plugin.version>1.0.0</lifecycle.mapping.plugin.version>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <developers>
        <developer>
            <name>Kaazing Corporation</name>
            <url>https://github.com/kaazing</url>
            <organization>Kaazing Corporation</organization>
            <organizationUrl>http://kaazing.org</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/kaazing/community</url>
        <connection>scm:git:https://github.com/kaazing/community.git</connection>
        <developerConnection>${project.scm.connection}</developerConnection>
    </scm>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-annotations</artifactId>
                <version>${animal.sniffer.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle.plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <phase>validate</phase>
                            <configuration>
                                <suppressionsLocation>
                                    ${checkstyle.suppressions.location}
                                </suppressionsLocation>
                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                                <consoleOutput>true</consoleOutput>
                                <logViolationsToConsole>true</logViolationsToConsole>
                                <failsOnError>true</failsOnError>
                                <failOnViolation>true</failOnViolation>
                                <configLocation>${checkstyle.config.location}</configLocation>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.kaazing</groupId>
                            <artifactId>code.quality</artifactId>
                            <version>${code.quality.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${failsafe.plugin.version}</version>
                    <configuration>
                        <skipTests>${skipITs}</skipTests>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc.plugin.version}</version>
                    <configuration>
                        <excludePackageNames>*.internal</excludePackageNames>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${gpg.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus.staging.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
                    <version>${animal.sniffer.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>default-animal-sniffer</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <signature>
                                    <groupId>${animal.sniffer.signature.groupId}</groupId>
                                    <artifactId>${animal.sniffer.signature.artifactId}</artifactId>
                                    <version>${animal.sniffer.signature.version}</version>
                                </signature>
                                <skip>${animal.sniffer.skip}</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${enforcer.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>default-enforce</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <evaluateBeanshell>
                                        <condition>!"${project.url}".startsWith("${project.parent.url}/")</condition>
                                        <message>MUST override POM url (project.url) or it starts with "${project.parent.url}/"</message>
                                    </evaluateBeanshell>
                                    <evaluateBeanshell>
                                        <condition>!"${project.scm.url}".startsWith("${project.parent.scm.url}/")</condition>
                                        <message>POM missing scm url (project.scm.url) or it starts with "${project.parent.scm.url}/"</message>
                                    </evaluateBeanshell>
                                    <evaluateBeanshell>
                                        <condition>!"${project.scm.connection}".startsWith("${project.parent.scm.connection}/")</condition>
                                        <message>POM missing scm connection (project.scm.connection) or it starts with "${project.parent.scm.connection}/"</message>
                                    </evaluateBeanshell>
                                    <requireJavaVersion>
                                        <version>${require.java.version}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                    <executions>
                        <execution>
                            <id>unpack</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>unpack</goal>
                            </goals>
                            <configuration>
                                <artifactItems>
                                    <artifactItem>
                                        <!-- includes common copyright headers for sources -->
                                        <groupId>org.kaazing</groupId>
                                        <artifactId>community.license</artifactId>
                                        <type>jar</type>
                                    </artifactItem>
                                </artifactItems>
                                <overWriteReleases>true</overWriteReleases>
                                <overWriteSnapshots>true</overWriteSnapshots>
                                <failOnMissingClassifierArtifact>true</failOnMissingClassifierArtifact>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <!-- To update the license, do: -->
                    <!--     mvn com.mycila:license-maven-plugin:RELEASE:format -DskipITs -DskipTests -->
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.3</version>
                    <configuration>
                        <header>${project.build.directory}/dependency/COPYRIGHT-community</header>
                        <failIfMissing>true</failIfMissing>
                        <useDefaultExcludes>true</useDefaultExcludes>
                        <includes>
                            <include>src/**</include>
                        </includes>
                        <excludes combine.children="append">
                            <exclude>**/*.db</exclude>
                            <exclude>**/*.woff</exclude>
                            <exclude>**/*.eps</exclude>
                            <exclude>**/*.psd</exclude>
                            <exclude>**/*.p12</exclude>
                            <exclude>**/3RDPARTY.txt</exclude>
                            <exclude>**/LICENSE.txt</exclude>
                            <!-- AppManifest.xml is generated by Visual Studio.
                                 Adding license causes build failure -->
                            <exclude>**/AppManifest.xml</exclude>

                            <exclude>**/NOTICE.txt</exclude>
                        </excludes>
                        <encoding>UTF-8</encoding>
                        <mapping>
                            <m>JAVADOC_STYLE</m>
                            <xsdconfig>XML_STYLE</xsdconfig>
                            <!-- Unix start and stop scripts -->
                            <start>SCRIPT_STYLE</start>
                            <stop>SCRIPT_STYLE</stop>
                            <!-- Robot scripts -->
                            <rpt>SCRIPT_STYLE</rpt>
                        </mapping>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>eclipse</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>${lifecycle.mapping.plugin.version}</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-enforcer-plugin</artifactId>
                                                <versionRange>${enforcer.plugin.version}</versionRange>
                                                <goals>
                                                    <goal>enforce</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore/>
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>Replace all
                                                SNAPSHOT dependencies
                                                with RELEASE versions</message>
                                        </requireReleaseDeps>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <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-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>bootstrap</id>
            <properties>
                <enforcer.skip>true</enforcer.skip>
                <checkstyle.skip>true</checkstyle.skip>
                <skipTests>true</skipTests>
                <skipITs>true</skipITs>
                <maven.javadoc.skip>true</maven.javadoc.skip>
            </properties>
        </profile>
    </profiles>

    <modules>
        <module>community.license</module>
        <module>community.main</module>
    </modules>
</project>
