<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <name>APIKit for SOAP CXF Server</name>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-soapkit-cxf</artifactId>
    <version>1.7.3</version>

    <properties>
        <mule.version>4.1.6</mule.version>
        <mule.api.version>1.1.5</mule.api.version>
        <mule.extensions.soap.api.version>1.1.6</mule.extensions.soap.api.version>
        <mule.tooling.api.version>1.1.5</mule.tooling.api.version>
        <mule.extensions.maven.plugin.version>1.1.6</mule.extensions.maven.plugin.version>

        <cxfVersion>3.5.10</cxfVersion>
        <woodstockVersion>5.4.0</woodstockVersion>
        <msvVersion>2013.6.1</msvVersion>
        <springVersion>5.3.39-spring-framework-5.3.45</springVersion>
        <xmlSecVersion>2.1.4</xmlSecVersion>
        <muleWsdlParserVersion>1.4.7</muleWsdlParserVersion>
        <guavaVersion>32.1.3-jre</guavaVersion>
        <staxUtilsVersion>20080702</staxUtilsVersion>
        <junitVersion>5.9.3</junitVersion>
        <javaVersion>1.8</javaVersion>
        <mockitoVersion>4.11.0</mockitoVersion>
        <commonsIoVersion>2.18.0</commonsIoVersion>
        <xmlbeansVersion>5.0.3</xmlbeansVersion>
        <jacoco.version>0.8.10</jacoco.version>
        <soap.engine.version>1.10.2</soap.engine.version>

        <licensePath>LICENSE_HEADER.txt</licensePath>
        <mavenCompilerVersion>3.8.1</mavenCompilerVersion>
        <mavenEnforcerPluginVersion>1.4.1</mavenEnforcerPluginVersion>
        <maven.surefire.plugin.version>3.2.2</maven.surefire.plugin.version>

        <!--formatter -->
        <skipVerifications>false</skipVerifications>
        <formatterPluginVersion>1.9.2</formatterPluginVersion>
        <formatterConfigPath>formatter.xml</formatterConfigPath>
        <formatterGoal>validate</formatterGoal>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.3.2</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>3.0</version>
                    <configuration>
                        <header>${licensePath}</header>
                        <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>**/*.wsdl</exclude>
                        </excludes>
                        <includes>
                            <include>**/*.java</include>
                        </includes>
                        <mapping>
                            <java>SLASHSTAR_STYLE</java>
                        </mapping>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.marvinformatics.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatterPluginVersion}</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>
                        <encoding>UTF-8</encoding>
                    </configuration>
                    <executions>
                        <execution>
                            <id>apply-format</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>${formatterGoal}</goal>
                            </goals>
                            <configuration>
                                <skipFormatting>${skipVerifications}</skipFormatting>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8 -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${session.executionRootDirectory}/target/jacoco.exec</argLine>
                    <systemPropertyVariables>
                        <!-- Just propagate this variable due to surefire will not do this when forked vm for tests -->
                        <mule.freePortFinder.lockPath>${java.io.tmpdir}/mule/freePortFinder</mule.freePortFinder.lockPath>
                        <maven.projectVersion>${project.version}</maven.projectVersion>
                    </systemPropertyVariables>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jacoco</groupId>
                        <artifactId>org.jacoco.agent</artifactId>
                        <version>${jacoco.version}</version>
                        <classifier>runtime</classifier>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${mavenCompilerVersion}</version>
                <configuration>
                    <source>${javaVersion}</source>
                    <target>${javaVersion}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
            <plugin>
                <groupId>org.mule.runtime.plugins</groupId>
                <artifactId>mule-extensions-maven-plugin</artifactId>
                <version>${mule.extensions.maven.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>com.marvinformatics.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <dependencies>

        <dependency>
            <groupId>org.mule.wsdl</groupId>
            <artifactId>mule-wsdl-parser</artifactId>
            <version>${muleWsdlParserVersion}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-rt-wsdle</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.mule.apache</groupId>
                    <artifactId>xerces2-xsd11</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>xmlbeans</artifactId>
                    <groupId>org.apache.xmlbeans</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Mule dependencies -->
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-core</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- SOAP dependencies, e.g SoapVersion, SoapAttachment, etc -->
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-soap-engine</artifactId>
            <version>${soap.engine.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-service-http-api</artifactId>
            <version>${mule.version}</version>
        </dependency>
        
        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-core</artifactId>
            <version>${cxfVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-simple</artifactId>
            <version>${cxfVersion}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-wsdl</artifactId>
            <version>${cxfVersion}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-local</artifactId>
            <version>${cxfVersion}</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.woodstox</groupId>
            <artifactId>woodstox-core</artifactId>
            <version>${woodstockVersion}</version>
        </dependency>

        <!-- Used when enableValidationEnabled=true -->
        <dependency>
            <groupId>net.java.dev.msv</groupId>
            <artifactId>msv-core</artifactId>
            <version>${msvVersion}</version>
        </dependency>

        <!-- These spring dependencies are needed by cxf's SpringBusFactory -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${springVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${springVersion}</version>
        </dependency>

        <!-- Common Dependencies -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guavaVersion}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commonsIoVersion}</version>
        </dependency>
        <!-- XML Handling -->
        <dependency>
            <groupId>net.java.dev.stax-utils</groupId>
            <artifactId>stax-utils</artifactId>
            <version>${staxUtilsVersion}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.bea.xml</groupId>
                    <artifactId>jsr173-ri</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>${xmlbeansVersion}</version>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-soapkit-common-test</artifactId>
            <version>1.1.14</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junitVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockitoVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockitoVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>1.3.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
            <version>2.3.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <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-ee-snapshots</id>
            <name>Mule Snapshot Repository</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/ci-snapshots</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>mulesoft-private</id>
            <name>Mulesoft internal repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/private/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-private</id>
            <name>Mulesoft internal repository</name>
            <url>https://repository.mulesoft.org/nexus/content/repositories/private/</url>
        </pluginRepository>
    </pluginRepositories>

    <scm>
        <connection>scm:git:git://github.com:mulesoft-emu/apikit-soap-cxf.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft-emu/apikit-soap-cxf.git</developerConnection>
        <url>http://github.com/mulesoft-emu/apikit-soap-cxf</url>
        <tag>HEAD</tag>
    </scm>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>${mavenEnforcerPluginVersion}</version>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots-in-deps</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>No Snapshots Allowed in Deps!</message>
                                            <excludes>
                                                <exclude>com.mulesoft.munit:munit-runner</exclude>
                                                <exclude>com.mulesoft.munit:munit-tools</exclude>
                                            </excludes>
                                        </requireReleaseDeps>
                                        <requireReleaseVersion>
                                            <message>No Snapshots Allowed in Project Version!</message>
                                        </requireReleaseVersion>
                                        <requirePluginVersions>
                                            <message>Best Practice is to always define plugin versions!</message>
                                            <unCheckedPluginList>
                                                com.mulesoft.munit:munit-extensions-maven-plugin,
                                                org.apache.maven.plugins:maven-source-plugin,
                                                org.apache.maven.plugins:maven-resources-plugin,
                                                org.apache.maven.plugins:maven-site-plugin,
                                                org.apache.maven.plugins:maven-javadoc-plugin,
                                                org.apache.maven.plugins:maven-surefire-plugin,
                                                org.apache.maven.plugins:maven-jar-plugin,
                                                org.apache.maven.plugins:maven-clean-plugin,
                                                org.apache.maven.plugins:maven-install-plugin,
                                                org.apache.maven.plugins:maven-deploy-plugin
                                            </unCheckedPluginList>
                                        </requirePluginVersions>
                                    </rules>
                                    <skip>false</skip>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
