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

	<name>Activiti - Cycle</name>
	<groupId>org.activiti</groupId>
	<artifactId>activiti-cycle</artifactId>

	<parent>
		<groupId>org.activiti</groupId>
		<artifactId>activiti-root</artifactId>
		<relativePath>../..</relativePath>
		<version>5.3</version>

	</parent>

	<properties>
		<activiti.artifact>org.activiti.cycle</activiti.artifact>
		<activiti.osgi.import.additional>
			*;resolution:=optional,
        </activiti.osgi.import.additional>
	</properties>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.*</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<excludes>			
            <exclude>**/AdjustShapeNamesForXmlNCNameTest.java</exclude>
            <exclude>**/FileSystemConnectorTest.java</exclude>
          <!--   <exclude>**/CycleDaoMyBatisImplTest.java</exclude> -->
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>cleanVersions</goal>
						</goals>
					</execution>
					<execution>
						<id>bundle-manifest</id>
						<phase>process-classes</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.activiti</groupId>
			<artifactId>activiti-engine</artifactId>
<!-- 			<scope>provided</scope> -->
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.restlet.jee</groupId>
			<artifactId>org.restlet</artifactId>
		</dependency>
		<dependency>
			<groupId>org.restlet.jee</groupId>
			<artifactId>org.restlet.ext.json</artifactId>
		</dependency>
		<dependency>
			<groupId>org.restlet.jee</groupId>
			<artifactId>org.restlet.ext.xml</artifactId>
		</dependency>
		<dependency>
			<groupId>org.restlet.jee</groupId>
			<artifactId>org.restlet.ext.httpclient</artifactId>
		</dependency>
		<!-- required by Apache commons httpclient, required by restlet -->
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
		</dependency>
		<!-- required for Activiti Cycle file system connector -->
		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
		</dependency>
		<!-- required for mimetype lookup -->
		<dependency>
			<groupId>eu.medsea.mimeutil</groupId>
			<artifactId>mime-util</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-jdk14</artifactId>
		</dependency>
		<dependency>
			<groupId>org.scannotation</groupId>
			<artifactId>scannotation</artifactId>
		</dependency>
		<!-- required to access ServletContext needed for PluginFinder in web context -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.signavio</groupId>
			<artifactId>signavio-core-components</artifactId>
		</dependency>
    <!-- jdbc drivers -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>
		<dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>postgresql</groupId>
      <artifactId>postgresql</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.jtds</groupId>
      <artifactId>jtds</artifactId>
      <scope>test</scope>
    </dependency>
		
	</dependencies>

	<profiles>
		<profile>
			<id>distro</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>2.1.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<phase>package</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<!--  database qa profile -->
 		<profile>
    	<id>database</id>
      <activation>
      	<property>
          <name>database</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <!--
              only worked with this version, there might be a bug with antrun
              see http://jira.codehaus.org/browse/MANTRUN-109
            -->
            <version>1.4</version>
            <executions>
              <execution>
                <id>database-test-create-schema</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <echo message="creating db schema in ${database}" />
                    <copy file="${basedir}/../../qa/db/activiti.cycle.cfg.xml" tofile="target/test-classes/activiti.cfg.xml" overwrite="true">
                      <filterset filtersfile="${user.home}/.activiti/jdbc/build.${database}.properties" />
                    </copy>
                  </tasks>
                </configuration>
              </execution>
              <execution>
                <id>database-test-drop-schema</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <echo message="dropping schema in ${database}" />
                    <java classname="org.activiti.engine.impl.db.DbSchemaDrop" classpathref="maven.test.classpath" />
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <profile>
      <id>oracle</id>
      <activation>
        <property>
          <name>database</name>
          <value>oracle</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.oracle.jdbc</groupId>
          <artifactId>ojdbc5</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    
    <profile>
      <id>db2</id>
      <activation>
        <property>
          <name>database</name>
          <value>db2</value>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.ibm.db2.jcc</groupId>
          <artifactId>db2jcc4</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    	
	</profiles>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<excludePackageNames>org.activiti.impl*,org.activiti.engine.impl*</excludePackageNames>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

</project>
