<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>7</version>
	</parent>

	<groupId>org.bonitasoft.engine</groupId>
	<artifactId>bonita-engine</artifactId>
	<version>6.5.2</version>
	<packaging>pom</packaging>

	<name>Bonita BPM Engine</name>
	<description>BonitaBPM Engine is a workflow engine which can be embedded inside your own applications.</description>
	<url>http://community.bonitasoft.com/</url>
	<organization>
		<name>Bonitasoft S.A.</name>
		<url>http://community.bonitasoft.com/</url>
	</organization>
	<licenses>
		<license>
			<name>GNU Lesser General Public License Version 2.1</name>
			<url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>bonita-engine-team</id>
			<name>The Bonita Engine Development Team</name>
			<organization>Bonitasoft S.A.</organization>
			<organizationUrl>http://community.bonitasoft.com/</organizationUrl>
		</developer>
	</developers>

	<prerequisites>
		<maven>3.0</maven>
	</prerequisites>

	<scm>
		<connection>scm:git:http://github.com/bonitasoft/bonita-engine.git</connection>
		<developerConnection>scm:git:git@github.com:bonitasoft/bonita-engine.git</developerConnection>
		<url>http://github.com/bonitasoft/bonita-engine</url>
	</scm>

	<properties>
		<slf4j.version>1.6.1</slf4j.version>
		<httpclient.version>4.2.5</httpclient.version>
		<xstream.version>1.4.2</xstream.version>
		<hibernate.version>4.2.13.Final</hibernate.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<spring.version>3.1.2.RELEASE</spring.version>

		<!-- Tests -->
		<powermock.version>1.5.1</powermock.version>

		<!-- ************************ -->
		<!-- Sonar/Reporting settings -->
		<!-- ************************ -->
		<!-- Sonar/Jacoco integration. Note that these properties need to be defined outside the "coverage" profile because we want to be to able to execute mvn sonar:sonar 
			without passing a profile -->
		<!-- Tells Sonar to use jacoco for coverage results -->
		<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
		<!-- Jacoco version to use -->
		<jacoco.version>0.7.2.201409121644</jacoco.version>
		<!-- The Sonar Jacoco Listener for JUnit to extract coverage details per test -->
		<sonar-jacoco-listeners.version>1.4</sonar-jacoco-listeners.version>
		<!-- Don't let Sonar execute tests. We will ask it to Maven -->
		<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
		<!-- Report output directory, in Jenkins use: -Djacoco.outputDir=${WORKSPACE} -->
		<jacoco.outputDir>${project.build.directory}</jacoco.outputDir>
		<!-- Jacoco output file for UTs -->
		<jacoco.out.ut.file>jacoco-ut.exec</jacoco.out.ut.file>
		<!-- Tells Sonar where the Jacoco coverage result file is located for Unit Tests -->
		<sonar.jacoco.reportPath>${jacoco.outputDir}/${jacoco.out.ut.file}</sonar.jacoco.reportPath>
		<!-- Jacoco output file for ITs -->
		<jacoco.out.it.file>jacoco-it.exec</jacoco.out.it.file>
		<!-- Tells Sonar where the Jacoco coverage result file is located for Integration Tests -->
		<sonar.jacoco.itReportPath>${jacoco.outputDir}/${jacoco.out.it.file}</sonar.jacoco.itReportPath>
        <sonar.exclusions>**/*Test.java,**/*Tests.java,**/*IT.java</sonar.exclusions>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
				<version>1.7</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>com.h2database</groupId>
				<artifactId>h2</artifactId>
				<version>1.3.175</version>
			</dependency>
			<dependency>
				<groupId>net.sf.ehcache</groupId>
				<artifactId>ehcache-core</artifactId>
				<version>2.4.7</version>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context</artifactId>
				<version>${spring.version}</version>
			</dependency>
			<dependency>
				<groupId>org.hibernate</groupId>
				<artifactId>hibernate-core</artifactId>
				<version>${hibernate.version}</version>
				<exclusions>
					<exclusion>
						<groupId>org.jboss.spec.javax.transaction</groupId>
						<artifactId>jboss-transaction-api_1.1_spec</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>2.1</version>
			</dependency>
			<dependency>
	            <groupId>org.apache.commons</groupId>
	            <artifactId>commons-lang3</artifactId>
	            <version>3.1</version>
	        </dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-collections4</artifactId>
				<version>4.0</version>
			</dependency>
			<!-- Tests -->
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.11</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.assertj</groupId>
				<artifactId>assertj-core</artifactId>
				<version>1.5.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-all</artifactId>
				<version>1.9.5</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.powermock</groupId>
				<artifactId>powermock-module-junit4</artifactId>
				<version>${powermock.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.powermock</groupId>
				<artifactId>powermock-api-mockito</artifactId>
				<version>${powermock.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-classic</artifactId>
				<version>1.0.11</version>
			</dependency>
			<dependency>
				<groupId>org.codehaus.btm</groupId>
				<artifactId>btm</artifactId>
				<version>2.1.4</version>
			</dependency>
			<dependency>
				<groupId>org.codehaus.btm</groupId>
				<artifactId>btm-tomcat55-lifecycle</artifactId>
				<version>2.1.4</version>
			</dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>1.8.6</version>
            </dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.7</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>2.2-beta-3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>2.5</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>2.8</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.1</version>
					<configuration>
						<deployAtEnd>true</deployAtEnd>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-ear-plugin</artifactId>
					<version>2.9</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-ejb-plugin</artifactId>
					<version>2.3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>1.3.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>2.16</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.5.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.9.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.4.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>2.6</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>2.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.2.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.16</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.cargo</groupId>
					<artifactId>cargo-maven2-plugin</artifactId>
					<version>1.4.11</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<dependencies>
					<dependency>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant-nodeps</artifactId>
						<version>1.8.1</version>
					</dependency>
					<dependency>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant-junit</artifactId>
						<version>1.8.1</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<executions>
					<execution>
						<id>enforce-versions</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>[3.0.0,)</version>
								</requireMavenVersion>
								<requireJavaVersion>
									<version>[1.6,)</version>
								</requireJavaVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<!-- Default failsafe configuration -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration>
					<argLine>-Xmx1024m -XX:MaxPermSize=256m
						-XX:+HeapDumpOnOutOfMemoryError</argLine>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>deploy</id>
			<modules>
				<module>bpm</module>
			</modules>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>all</id>
			<modules>
				<module>services</module>
				<module>bpm</module>
				<module>bonita-integration-tests</module>
			</modules>
			<properties>
				<maven.test.skip>false</maven.test.skip>
				<maven.javadoc.skip>false</maven.javadoc.skip>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>fast</id>
			<modules>
				<module>services</module>
				<module>bpm</module>
				<module>bonita-integration-tests</module>
			</modules>
			<properties>
				<skipTests>true</skipTests>
				<maven.javadoc.skip>true</maven.javadoc.skip>
			</properties>
		</profile>
		<profile>
			<id>package</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<modules>
				<module>services</module>
				<module>bpm</module>
				<module>bonita-integration-tests</module>
			</modules>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>package-all</id>
			<modules>
				<module>services</module>
				<module>bpm</module>
				<module>bonita-integration-tests</module>
			</modules>
			<properties>
				<skipTests>true</skipTests>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>tests</id>
			<properties>
				<maven.javadoc.skip>true</maven.javadoc.skip>
			</properties>
			<modules>
				<module>services</module>
				<module>bpm</module>
				<module>bonita-integration-tests</module>
			</modules>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>sonar</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<argLine>${jacoco.agent.ut.arg}</argLine>
							<!-- Listener to show coverage for each test -->
							<properties>
								<property>
									<name>listener</name>
									<value>org.sonar.java.jacoco.JUnitListener</value>
								</property>
							</properties>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<configuration>
							<!-- Be aware not to omit ${jacoco.agent.it.arg} if overriding this property in lower-level pom files: -->
							<argLine>-Xmx1024m -XX:MaxPermSize=256m
								-XX:+HeapDumpOnOutOfMemoryError ${jacoco.agent.it.arg}</argLine>
							<!-- Listener to show coverage for each test -->
							<properties>
								<property>
									<name>listener</name>
									<value>org.sonar.java.jacoco.JUnitListener</value>
								</property>
							</properties>
							<!-- workaround to have test report for IT in sonar, see http://stackoverflow.com/a/15567782/936729 -->
							<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${jacoco.version}</version>
						<configuration>
							<includes>
								<include>org.bonitasoft.engine.*</include>
							</includes>
						</configuration>
						<executions>
							<!-- Prepares a variable, jacoco.agent.ut.arg, that contains the info to be passed to the JVM hosting the code being tested. -->
							<execution>
								<id>prepare-ut-agent</id>
								<phase>process-test-classes</phase>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<destFile>${sonar.jacoco.reportPath}</destFile>
									<propertyName>jacoco.agent.ut.arg</propertyName>
									<append>true</append>
								</configuration>
							</execution>
							<!-- Prepares a variable, jacoco.agent.it.arg, that contains the info to be passed to the JVM hosting the code being tested. -->
							<execution>
								<id>prepare-it-agent</id>
								<phase>pre-integration-test</phase>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<destFile>${sonar.jacoco.itReportPath}</destFile>
									<propertyName>jacoco.agent.it.arg</propertyName>
									<append>true</append>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<dependencies>
				<dependency>
					<groupId>org.codehaus.sonar-plugins.java</groupId>
					<artifactId>sonar-jacoco-listeners</artifactId>
					<version>${sonar-jacoco-listeners.version}</version>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
	</profiles>
</project>
