<?xml version='1.0' encoding='UTF-8'?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements. See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership. The ASF licenses this file
  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 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>
    <artifactId>maven-plugins</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <version>34</version>
  </parent>

  <groupId>org.mule.runtime.plugins</groupId>
  <artifactId>mule-extensions-shade-plugin</artifactId>
  <version>1.0.0</version>
  <packaging>maven-plugin</packaging>

  <name>Mule Extensions Maven Shade Plugin</name>
  <description>
    Repackages the extensions classes together with their dependencies into a single plugin, optionally renaming classes
    or removing unused classes.
  </description>

  <properties>
    <mavenVersion>3.0</mavenVersion>
    <javaVersion>7</javaVersion>
    <currentVersion>${project.version}</currentVersion>
    <asmVersion>9.0</asmVersion>
    <project.build.outputTimestamp>2020-05-23T15:29:40Z</project.build.outputTimestamp>
<!--    Disable Maven checklist in favor of mule's-->
    <checkstyle.skip>true</checkstyle.skip>
    <license.maven.plugin.version>2.11</license.maven.plugin.version>
    <javaFormatter.plugin.version>1.9.0</javaFormatter.plugin.version>
    <formatterConfigPath>formatter.xml</formatterConfigPath>
    <formatterGoal>validate</formatterGoal>
  </properties>

  <developers>
    <developer>
      <id>marianogonzalez</id>
      <name>Mariano Gonzalez</name>
    </developer>
  </developers>

  <dependencies>
    <!-- Maven -->
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Plexus -->
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.3.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-artifact-transfer</artifactId>
      <version>0.12.0</version>
    </dependency>
    <!-- Others -->
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>${asmVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-commons</artifactId>
      <version>${asmVersion}</version>
    </dependency>

    <dependency>
      <groupId>org.jdom</groupId>
      <artifactId>jdom2</artifactId>
      <version>2.0.6</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-dependency-tree</artifactId>
      <version>3.0.1</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.6</version>
    </dependency>
    <dependency>
      <groupId>org.vafer</groupId>
      <artifactId>jdependency</artifactId>
      <version>2.5.0</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-component-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.xmlunit</groupId>
      <artifactId>xmlunit-legacy</artifactId>
      <version>2.7.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>30.0-android</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.8.1</version>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.28.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <executions>
            <execution>
              <id>enforce-bytecode-version</id>
              <configuration>
                <rules>
                  <enforceBytecodeVersion>
                    <ignoreClasses>
                      <ignoreClass>module-info</ignoreClass>
                    </ignoreClasses>
                    <excludes>
                      <exclude>org.vafer:jdependency</exclude>
                    </excludes>
                  </enforceBytecodeVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludes combine.children="append">
            <!-- Can't add license header otherwise the tests will fail. -->
            <exclude>src/it/mrm/repository/services-resource-transformer/*/META-INF/services/org.apache.maven.Shade</exclude>
            <exclude>src/it/mrm/repository/services-resource-transformer-with-reloc-includes-excludes/*/META-INF/services/org.apache.maven.shade</exclude>
            <exclude>rel-path-test-files/**</exclude>
            <exclude>src/it/projects/dep-reduced-pom-use-base-version/repo/org/apache/maven/its/shade/drp/a/0.1-SNAPSHOT/_maven.repositories</exclude>
            <exclude>src/it/projects/mshade-123/sample.txt</exclude>
            <exclude>src/it/projects/MSHADE-133/src/main/resources/myConfig.yml</exclude>
            <exclude>src/it/projects/rerun-with-reloc/src/main/resources/some-ordinary-resource.txt</exclude>
            <exclude>src/it/projects/rerun-without-reloc/src/main/resources/some-ordinary-resource.txt</exclude>
            <exclude>src/it/projects/MSHADE-182/src/main/resources/META-INF/services/relocateme.Service</exclude>
            <exclude>src/main/java/org/mule/**</exclude>
            <exclude>*.xml</exclude>
            <exclude>*.adoc</exclude>
            <exclude>*.yaml</exclude>
            <exclude>Jenkinsfile</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.marvinformatics.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <version>${javaFormatter.plugin.version}</version>
        <configuration>
          <compilerCompliance>${javaVersion}</compilerCompliance>
          <compilerSource>${javaVersion}</compilerSource>
          <compilerTargetPlatform>${javaVersion}</compilerTargetPlatform>
          <configFile>${basedir}/${formatterConfigPath}</configFile>
          <configJsFile>${basedir}/${formatterConfigPath}</configJsFile>
          <aggregator>false</aggregator>
          <executionRoot>true</executionRoot>
        </configuration>
        <executions>
          <execution>
            <id>apply-format</id>
            <phase>compile</phase>
            <goals>
              <goal>${formatterGoal}</goal>
            </goals>
            <configuration>
              <skipFormatting>${skipVerifications}</skipFormatting>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license.maven.plugin.version}</version>
        <configuration>
          <skip>${skipVerifications}</skip>
          <header>com/mycila/maven/plugin/license/templates/CPAL.txt</header>
          <properties>
            <owner>MuleSoft, Inc</owner>
            <project.url>http://www.mulesoft.com</project.url>
          </properties>
          <excludes>
            <exclude>target/**</exclude>
            <exclude>**/.gitignore</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>**/*.groovy</exclude>
            <exclude>**/*.sh</exclude>
            <exclude>**/*.bat</exclude>
            <exclude>**/*.ftl</exclude>
            <exclude>**/*.xml</exclude>
            <exclude>**/*.properties</exclude>
            <exclude>**/*.sample</exclude>
            <exclude>**/*.md</exclude>
            <exclude>**/*.xsl</exclude>
            <exclude>**/*.html</exclude>
            <exclude>**/*.css</exclude>
            <exclude>**/build-number.txt</exclude>
            <exclude>**/org/apache/**</exclude>
          </excludes>
          <includes>
            <include>**/org/mule/**/*.java</include>
          </includes>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
          </mapping>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
              <goal>generate-test-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <distributionManagement>
    <repository>
      <id>mule-releases</id>
      <name>Mule Release Repository</name>
      <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>mule-snapshots</id>
      <name>Mule Snapshot Repository</name>
      <url>https://repository-master.mulesoft.org/nexus/content/repositories/snapshots</url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
  </distributionManagement>

  <scm>
    <connection>scm:git:git://github.com/mulesoft/mule-extensions-shade-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:mulesoft/mule-extensions-shade-plugin.git</developerConnection>
    <url>https://github.com/mulesoft/mule-extensions-shade-plugin</url>
    <tag>HEAD</tag>
  </scm>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>test-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <goals>
                <goal>package</goal>
              </goals>
              <showErrors>true</showErrors>
              <projectsDirectory>src/it/projects</projectsDirectory>
              <settingsFile>src/it/mrm/settings.xml</settingsFile>
              <extraArtifacts>
                <extraArtifact>org.apache.maven.plugins:maven-shade-plugin:${project.version}:test-jar</extraArtifact>
              </extraArtifacts>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>mrm-maven-plugin</artifactId>
            <version>1.2.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>start</goal>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <repositories>
                <mockRepo>
                  <source>src/it/mrm/repository</source>
                  <cloneTo>target/mock-repo</cloneTo> <!-- due to on the fly created jars -->
                </mockRepo>
                <proxyRepo />
              </repositories>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
