<?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>

    <parent>
        <groupId>com.mulesoft.runtime.ang</groupId>
        <artifactId>mule-ang-introspection-service-parent</artifactId>
        <version>1.0.0</version>
    </parent>

    <artifactId>mule-ang-introspection-service-introspector</artifactId>

    <name>Mule ANG introspection Service - Introspector</name>
    <description>Mule App introspector</description>

    <properties>
        <formatterConfigPath>../formatter.xml</formatterConfigPath>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.mulesoft.runtime.ang.classpath.ModuleRepositoryGenerator</mainClass>
                    <arguments>
                        <argument>${project.build.outputDirectory}</argument>
                    </arguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <schedulersSampleApp>${com.mulesoft.runtime.ang:schedulers-sample:jar:mule-application}</schedulersSampleApp>
                        <schedulersWithPropertiesSampleApp>${com.mulesoft.runtime.ang:schedulers-with-properties-sample:jar:mule-application}</schedulersWithPropertiesSampleApp>
                        <!-- TODO MMP-581 uncomment this -->
                        <!-- <schedulersSampleAppWithImport>${com.mulesoft.runtime.ang:schedulers-sample-with-import:jar:mule-application}</schedulersSampleAppWithImport> -->
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <!-- The environment where this module runs already provides a logging implementation -->
                                    <!-- Make sure we are not providing any log impl ourselves that may cause some trouble -->
                                    <excludes>
                                        <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
                                        <exclude>ch.qos.logback:logback-core</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.mulesoft.runtime.ang</groupId>
            <artifactId>mule-ang-introspection-service-classpath</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-ast-xml-parser</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.mule.glassfish.jaxb</groupId>
                    <artifactId>jaxb-runtime</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-artifact-ast-serialization</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-javaee</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-deployment-model-impl</artifactId>
            <exclusions>
                <!-- logging will be provided by the container of this library -->
                <exclusion>
                    <groupId> org.mule.runtime</groupId>
                    <artifactId>mule-module-logging</artifactId>
                </exclusion>
                <!-- no need for feature mgmt for this functionality -->
                <exclusion>
                    <groupId>org.mule.runtime</groupId>
                    <artifactId>mule-module-feature-management</artifactId>
                </exclusion>
                <!-- exclude dependencies of the execution engine that won't 
                    be needed for introspection -->
                <exclusion>
                    <groupId>org.mule.runtime</groupId>
                    <artifactId>mule-extensions-api-dsql</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.projectreactor.addons</groupId>
                    <artifactId>reactor-extra</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.projectreactor</groupId>
                    <artifactId>reactor-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.conversantmedia</groupId>
                    <artifactId>disruptor</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.bytebuddy</groupId>
                    <artifactId>byte-buddy</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>cglib</groupId>
                    <artifactId>cglib-nodep</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-cli</groupId>
                    <artifactId>commons-cli</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-beanutils</groupId>
                    <artifactId>commons-beanutils</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-pool2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.jodah</groupId>
                    <artifactId>failsafe</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-tls</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-extensions-xml-support</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.mule.runtime</groupId>
                    <artifactId>mule-module-extensions-spring-support</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.mule.runtime.modules</groupId>
            <artifactId>mule-runtime-ee-extension-model</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.mule.runtime</groupId>
                    <artifactId>mule-metadata-model-raml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>api-gateway-api</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.mule</groupId>
                    <artifactId>mule-encryption</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-autodiscovery</artifactId>
        </dependency>

        <dependency>
            <groupId>com.mulesoft.runtime.ang</groupId>
            <artifactId>mule-ang-introspection-service-allure</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjrt</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.mulesoft.runtime.ang</groupId>
            <artifactId>schedulers-sample</artifactId>
            <version>${project.version}</version>
            <classifier>mule-application</classifier>
            <scope>test</scope>
        </dependency>
        <!-- TODO MMP-581 uncomment this -->
<!--         <dependency> -->
<!--             <groupId>com.mulesoft.runtime.ang</groupId> -->
<!--             <artifactId>schedulers-sample-with-import</artifactId> -->
<!--             <version>${project.version}</version> -->
<!--             <classifier>mule-application</classifier> -->
<!--             <scope>test</scope> -->
<!--             <exclusions> -->
<!--                 Avoid having the transitive dependencies resources accessible through the surefire classloader -->
<!--                 <exclusion> -->
<!--                     <groupId>*</groupId> -->
<!--                     <artifactId>*</artifactId> -->
<!--                 </exclusion> -->
<!--             </exclusions> -->
<!--         </dependency> -->
        <dependency>
            <groupId>com.mulesoft.runtime.ang</groupId>
            <artifactId>schedulers-with-properties-sample</artifactId>
            <version>${project.version}</version>
            <classifier>mule-application</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.mulesoft.runtime.ang</groupId>
            <artifactId>mule-ang-introspection-service-schedulers-dialect</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>1.19.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
