<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

  <!--
    This is the default parent-pom for integration components based on
    soi-toolkit.
    There is no parent to this pom since it should be standalone and only force
    a minimum set of constraints on integration components.
  -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>se.skltp.commons</groupId>
  <artifactId>skltp-commons-mule-parent</artifactId>
  <packaging>pom</packaging>
  <version>2.0.2</version>
  <name>skltp-commons-mule-parent</name>

  <scm>
    <url>http://github.com/skltp/commons-mule-parent.git</url>
    <connection>scm:git:git://github.com/skltp/commons-mule-parent.git</connection>
    <developerConnection>scm:git:git://github.com/skltp/commons-mule-parent.git</developerConnection>
    <tag>v2.0.2</tag>
  </scm>

  <properties>
		<!-- WARNING: Using ${project.version} will not work here, 
		     an integration component that refer to soitoolkit.version will get it translated 
			 to its own project-version and not soi-toolkits. 
			 So we have to specify the soitoolkit-version twice! 
		-->
    <soitoolkit.version>2.0.0-M6</soitoolkit.version>
    
    <compiler.target.version>1.8</compiler.target.version>
    <compiler.source.version>1.8</compiler.source.version>
    
    <!-- ************************************************************* -->
    <!-- dependency versions - please keep list alphabetically ordered -->
    <!-- ************************************************************* -->
    <log4j.version>1.2.17</log4j.version>
    <slf4j.version>1.7.21</slf4j.version>
    
    <!-- ********************************************************* -->
    <!-- plugin versions - please keep list alphabetically ordered -->
    <!-- ********************************************************* -->
    <cxf-codegen-plugin.version>3.1.6</cxf-codegen-plugin.version>
    <exec-maven-plugin.version>1.5.0</exec-maven-plugin.version>
    <maven-assembly-plugin.version>2.6</maven-assembly-plugin.version>
    <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
    <maven-compiler-plugin.version>2.5.1</maven-compiler-plugin.version>
    <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
    <maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version> <!-- retired -->
    <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
    <!-- 
    Newer versions of the jar-plugin does not seem to work with the current configuration, i.e. 
    when there is a plugin section for test-jar in this pom and a plugin section for the core jar in
    another pom.
    -->
    <maven-jar-plugin.version>2.3.1</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
    <maven-mule-plugin.version>1.9</maven-mule-plugin.version>    
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
    <maven-site-plugin.version>3.5.1</maven-site-plugin.version>
    <maven-scm-plugin.version>1.9.4</maven-scm-plugin.version>
    <maven-source-plugin.version>3.0.0</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
    <maven-verifier-plugin.version>1.1</maven-verifier-plugin.version>
    <maven-war-plugin.version>2.6</maven-war-plugin.version>
    <properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
    <studio-maven-plugin.version>3.4.2</studio-maven-plugin.version>

	<!-- Turn off strict checking of javadoc tags for Java 8 -->
    <additionalparam>-Xdoclint:none</additionalparam>

	</properties>
	
    <repositories>
        <repository>
          <id>mulesoft-public</id>
          <name>Mulesoft dependencies repository</name>
          <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
        </repository>

        <repository>
            <id>mulesoft-releases</id>
            <name>Mulesoft releases repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
        </repository>
    </repositories>

	  <pluginRepositories>
	     <pluginRepository>
	         <!-- for org.mule.tools:studio-maven-plugin -->
	         <id>mulesoft-releases</id>
	         <name>Mulesoft releases repository</name>
	         <layout>default</layout>
	         <url>https://repository.mulesoft.org/releases/</url>
	         <snapshots>
	            <enabled>false</enabled>
	         </snapshots>
	     </pluginRepository>
	</pluginRepositories>
  

  <dependencyManagement>
    <dependencies>
      <!-- ****************************************************** -->
      <!-- dependencies - please keep list alphabetically ordered -->
      <!-- ****************************************************** -->
      <!-- log4j: replaced with log4j2 from mule 3.6.0 -->
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
      </dependency>
      <!-- slf4j: version varies with mule version - but kept here to ensure
        classpath consistency over different slf4j dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>jcl-over-slf4j</artifactId>
         <version>${slf4j.version}</version>
      </dependency>
      <!-- TODO: add slf4j's JCL-bridge (jcl-over-slf4j.jar) when
        JCL has been excluded from classpath - is currently in -->


      <!--
      Workaround for issue with missing jug-dependency after shutdown of the
      codehaus.org maven-repository.
      Valid for Mule 3.3.1 and soi-toolkit versions < 2.0.0-M5. Refer to: https://skl-tp.atlassian.net/browse/SKLTP-646 https://github.com/soi-toolkit/soi-toolkit-mule/issues/396 Note: for Mule 3.3.1, the jug-dependency is being referenced with compile time scope as below, so we will still have the correct jug-dependency in the classpath. >mvn dependency:tree

      org.soitoolkit.commons.poms.mule-dependencies:soitoolkit-mule-3.3.1-dependencies:pom:0.6.1:compile
        org.mule:mule-core:jar:3.3.1:compile
          org.mule.tests:mule-tests-functional:jar:3.3.1:compile
            org.mule:mule-core:test-jar:tests:3.3.1:compile
              org.safehaus.jug:jug:jar:asl:2.0.0:compile
      -->
      <dependency>
        <groupId>org.soitoolkit.commons.poms.mule-dependencies</groupId>
        <artifactId>soitoolkit-mule-3.3.1-dependencies</artifactId>
        <version>${soitoolkit.version}</version>
        <type>pom</type>
        <exclusions>
          <exclusion>
            <groupId>org.safehaus.jug</groupId>
            <artifactId>jug.osgi</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <!-- ************************************************* -->
        <!-- plugins - please keep list alphabetically ordered -->
        <!-- ************************************************* -->
        <plugin>
          <!-- CXF plugin for generating JAX-WS/JAXB src code from WSDL/XSD -->
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-codegen-plugin</artifactId>
          <version>${cxf-codegen-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>${exec-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${maven-assembly-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>${maven-eclipse-plugin.version}</version>
        </plugin>
        <!--
          Note: maven-enforcer-plugin version specified in sonatype parent
          pluginManagement-section, we need to be explicit with version
          where the plugin is declared since override of version here does
          not seem to work (we pick up the older version from the parent).
        -->        
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven-enforcer-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>        
        <plugin>
          <groupId>org.mule.tools</groupId>
          <artifactId>maven-mule-plugin</artifactId>
          <version>${maven-mule-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-scm-plugin</artifactId>
          <version>${maven-scm-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-verifier-plugin</artifactId>
          <version>${maven-verifier-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven-war-plugin.version}</version>
        </plugin>
        <plugin>
          <!--
            Plugin for generating Mule Studio project files from a pom.xml using:
              mvn studio:studio (instead of mvn eclipse:eclipse)
          -->
          <groupId>org.mule.tools</groupId>
          <artifactId>studio-maven-plugin</artifactId>
          <version>${studio-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- ************************************************* -->
      <!-- plugins - please keep list alphabetically ordered -->
      <!-- ************************************************* -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${compiler.source.version}</source>
          <target>${compiler.target.version}</target>
        </configuration>
      </plugin>
      
      <plugin>
        <!-- download source jar's for our dependencies whenever possible -->
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>false</downloadJavadocs>
        </configuration>
      </plugin>
            
      <!--
        Note: maven-enforcer-plugin version specified in sonatype parent
        pluginManagement-section, we need to be explicit with version
        where the plugin is declared since override of version here does
        not seem to work (we pick up the older version from the parent).
      -->
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>soi-toolkit: enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>

                <requirePluginVersions>
                  <message>### Best Practice is to always define plugin versions! ###</message>
                  <!-- Don't check soi-tk plugins, i.e. enable SNAPSHOT-builds with soi-tk -->
                  <unCheckedPluginList>org.soitoolkit.tools.generator:soitoolkit-generator-maven-plugin</unCheckedPluginList>
                </requirePluginVersions>

                <requireMavenVersion>
                  <version>[3.0.3,)</version>
                </requireMavenVersion>
                
                <requireJavaVersion>
                  <version>[1.6.0,)</version>
                </requireJavaVersion>                
                
              </rules>
              <failFast>false</failFast>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <!-- create test-jar files -->
        <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-release-plugin</artifactId>
		<version>${maven-release-plugin.version}</version>
		<configuration>
			<autoVersionSubmodules>true</autoVersionSubmodules>
			<tagNameFormat>v@{project.version}</tagNameFormat>
			<pushChanges>false</pushChanges>
			<localCheckout>true</localCheckout>
		</configuration>
	</plugin>
		
      <plugin>
        <!-- create source jar files -->
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <!-- The id must be "attach-sources" to override plugin-config from
                Sonatypes parent, otherwise the sorce-jar will be attached
                twice during a release (if the release-plugin is used).
                See issue #100: http://code.google.com/p/soi-toolkit/issues/detail?id=100
            -->
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <!-- Creates a property file that can be used at runtime,
          e.g. by a monitor-service to provide build-info,
          see build-properties in the top of this file -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <version>${properties-maven-plugin.version}</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>write-project-properties</goal>
            </goals>
            <configuration>
              <outputFile>
                ${project.build.outputDirectory}/${project.artifactId}-build.properties
              </outputFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
    </plugins>
  </build>
</project>
