<!--

    Copyright (C) 2011-2022 Red Hat, Inc. (http://github.com/Commonjava/commonjava)

    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>

  <groupId>org.commonjava</groupId>
  <artifactId>commonjava</artifactId>
  <version>18</version>
  <packaging>pom</packaging>

  <name>CommonJava Top-Level Parent POM</name>

  <url>https://github.com/Commonjava/commonjava</url>

  <description>CommonJava top-level parent POM.</description>
  <inceptionYear>2011-2022</inceptionYear>

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

  <developers>
    <developer>
      <id>Red Hat, Inc.</id>
      <name>Red Hat, Inc.</name>
      <organization>Red Hat, Inc.</organization>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/Commonjava/commonjava.git</connection>
    <developerConnection>scm:git:git@github.com:Commonjava/commonjava.git</developerConnection>
    <url>http://github.com/Commonjava/commonjava</url>
    <tag>commonjava-18</tag>
  </scm>

  <properties>
    <javaVersion>1.8</javaVersion>
    <javaTestVersion>${javaVersion}</javaTestVersion>
    <projectOwner>Red Hat, Inc.</projectOwner>
    <projectEmail>http://github.com/Commonjava/commonjava</projectEmail>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.plugin.compiler>3.8.1</version.plugin.compiler>
    <version.plugin.plugin>3.6.2</version.plugin.plugin>
    <version.plugin.plexus-component-metadata>1.6</version.plugin.plexus-component-metadata>
    <version.plugin.release>2.5.3</version.plugin.release>
    <version.plugin.enforcer>3.0.0</version.plugin.enforcer>
    <version.plugin.assembly>3.3.0</version.plugin.assembly>
    <version.plugin.jar>3.2.0</version.plugin.jar>
    <version.plugin.source>3.2.1</version.plugin.source>
    <version.plugin.javadoc>3.3.1</version.plugin.javadoc>
    <version.plugin.gpg>3.0.1</version.plugin.gpg>
    <version.plugin.surefire>2.22.2</version.plugin.surefire>
    <version.plugin.failsafe>2.22.2</version.plugin.failsafe>
    <version.plugin.clean>3.1.0</version.plugin.clean>
    <version.plugin.deploy>2.8.2</version.plugin.deploy>
    <version.plugin.install>2.5.2</version.plugin.install>
    <version.plugin.resources>3.2.0</version.plugin.resources>
    <version.plugin.site>3.9.1</version.plugin.site>
    <version.plugin.pmd>3.9.0</version.plugin.pmd>
    <version.plugin.jacoco>0.8.7</version.plugin.jacoco>

    <plugin.jacoco.skip>true</plugin.jacoco.skip>

    <skipIllegalTransitiveEnforcement>false</skipIllegalTransitiveEnforcement>
    <enforceManagedDeps>true</enforceManagedDeps>

    <unEnforcedPlugins>org.eclipse.m2e:lifecycle-mapping</unEnforcedPlugins>
    <enforcedMavenVersion>(3.0.0,)</enforcedMavenVersion>
    <enforcedJavaVersion>${javaVersion}</enforcedJavaVersion>

    <enforceBestPractices>true</enforceBestPractices>
    <enforceStandards>true</enforceStandards>
    <enforceVersions>true</enforceVersions>
    <enforceTripHazards>true</enforceTripHazards>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${version.plugin.compiler}</version>
          <configuration>
            <source>${javaVersion}</source>
            <target>${javaVersion}</target>
            <testSource>${javaTestVersion}</testSource>
            <testTarget>${javaTestVersion}</testTarget>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${version.plugin.plugin}</version>
          <executions>
            <execution>
              <id>generate-descriptor</id>
              <goals>
                <goal>descriptor</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-metadata</artifactId>
          <version>${version.plugin.plexus-component-metadata}</version>
          <executions>
            <execution>
              <id>components.xml</id>
              <goals>
                <goal>generate-metadata</goal>
                <goal>generate-test-metadata</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${version.plugin.surefire}</version>
          <configuration>
            <excludes>
              <exclude>**/*Fixture*.java</exclude>
              <exclude>**/fixture/*.java</exclude>
              <exclude>**/*Live*.java</exclude>
              <exclude>**/live/*.java</exclude>
              <exclude>**/live/**/*.java</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${version.plugin.failsafe}</version>
          <configuration>
            <excludes>
              <exclude>**/*Fixture*.java</exclude>
              <exclude>**/fixture/*.java</exclude>
            </excludes>
            <includes>
              <exclude>**/*Live*.java</exclude>
              <include>**/live/*.java</include>
              <include>**/live/**/*.java</include>
            </includes>
          </configuration>
          <executions>
            <execution>
              <id>integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${version.plugin.release}</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Prelease</arguments>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${version.plugin.enforcer}</version>
          <executions>
            <execution>
              <id>enforce-best-practices</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <phase>process-classes</phase>
              <configuration>
                <fail>${enforceBestPractices}</fail>
                <rules>
                  <requireNoRepositories>
                    <allowedRepositories>sonatype-snapshots</allowedRepositories>
                    <allowSnapshotRepositories>true</allowSnapshotRepositories>
                  </requireNoRepositories>
                  <requirePluginVersions>
                    <banLatest />
                    <banRelease />
                    <banSnapshots />
                    <unCheckedPluginList>${unEnforcedPlugins}</unCheckedPluginList>
                  </requirePluginVersions>
                </rules>
              </configuration>
            </execution>
            <execution>
              <id>enforce-versions</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <fail>${enforceVersions}</fail>
                <rules>
                  <requireMavenVersion>
                    <version>${enforcedMavenVersion}</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>${enforcedJavaVersion}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${version.plugin.assembly}</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.plugin.jar}</version>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.10</version>
          <configuration>
            <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
            <properties>
              <owner>${projectOwner}</owner>
              <email>${projectEmail}</email>
            </properties>
            <excludes>
              <exclude>**/README*</exclude>
              <exclude>**/LICENSE*</exclude>
              <exclude>src/test/resources/**</exclude>
              <exclude>src/main/resources/**</exclude>
              <exclude>**/*.groovy</exclude>
            </excludes>
            <mapping>
              <service>SCRIPT_STYLE</service>
            </mapping>
          </configuration>
        </plugin>

        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <versionRange>[3.2,)</versionRange>
                    <goals>
                      <goal>descriptor</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${version.plugin.source}</version>
          <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>
          <version>${version.plugin.javadoc}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <detectOfflineLinks>false</detectOfflineLinks>
                <additionalparam>-Xdoclint:none</additionalparam>
                <additionalOptions>-Xdoclint:none</additionalOptions>
                <additionalJOption>-Xdoclint:none</additionalJOption>
                <doclint>none</doclint>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${version.plugin.gpg}</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${version.plugin.clean}</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${version.plugin.deploy}</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${version.plugin.install}</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${version.plugin.resources}</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${version.plugin.site}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${version.plugin.pmd}</version>
          <configuration>
            <targetJdk>${javaVersion}</targetJdk>
            <ruleset>pmd-ruleset.xml</ruleset>
          </configuration>
          <executions>
            <execution>
              <phase>process-sources</phase>
              <goals>
                <goal>check</goal>
                <goal>pmd</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${version.plugin.jacoco}</version>
          <configuration>
            <skip>${plugin.jacoco.skip}</skip>
      	  </configuration>
          <executions>
            <execution>
              <id>prepare-ut</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>prepare-it</id>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
            </execution>
            <execution>
              <id>report</id>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>formatting</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-sources</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>cq</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>parent-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>*-ruleset.xml</exclude>
                <exclude>codestyles/**</exclude>
                <exclude>**/README*</exclude>
                <exclude>**/LICENSE*</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <releases><enabled>false</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
    </repository>
  </repositories>

</project>
