Skip to content
Snippets Groups Projects
pom.xml 74.1 KiB
Newer Older
bps's avatar
bps committed
<?xml version="1.0"?>
<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>
	<groupId>org.openolat</groupId>
	<artifactId>openolat-lms</artifactId>
	<version>9.3-SNAPSHOT</version>
bps's avatar
bps committed
	<packaging>war</packaging>
	<name>OpenOLAT LMS</name>
	<url>http://www.openolat.org</url>
bps's avatar
bps committed
	<description>
  Welcome to the OpenOLAT (Open Online Learning And Training) Developer Project Site.  This site
bps's avatar
bps committed
  contains materials chiefly of concern to developers (e.g., unit testing and SCA output etc.)
  and is rebuilt periodically on a regular basis.  The site structure is divided between
  project information (e.g., infrastructure, mailing lists, repositories etc.) and reports
  (e.g., unit testing, SCAs etc.)
  </description>
	<organization>
		<name>OpenOLAT</name>
		<url>http://www.openolat.org</url>
bps's avatar
bps committed
	</organization>
	<licenses>
		<license>
			<name>Apache 2.0 Open Source License</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
			<distribution>manual</distribution>
			<comments>
		OpenOLAT is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
bps's avatar
bps committed
		</comments>
		</license>
	</licenses>
	<distributionManagement>
		<repository>
			<name>OpenOLAT Internal Nexus Release Repository</name>
			<url>http://nexus.openolat.org/nexus/content/repositories/openolat</url>
bps's avatar
bps committed
		</repository>
		<snapshotRepository>
			<name>OpenOLAT Internal Nexus Snapshot Repository</name>
			<url>http://nexus.openolat.org/nexus/content/repositories/openolat-snapshots</url>
bps's avatar
bps committed
		</snapshotRepository>
	</distributionManagement>
	<issueManagement>
		<system>JIRA</system>
		<url>http://jira.openolat.org</url>
bps's avatar
bps committed
	</issueManagement>
	<scm>
		<connection>scm:hg:http://hg.openolat.org</connection>
		<developerConnection>scm:hg:http://hg.openolat.org</developerConnection>
		<url>http://hg.openolat.org</url>
bps's avatar
bps committed
	</scm>
	<mailingLists>
		<mailingList>
			<name>openolat</name>
			<subscribe>https://groups.google.com/forum/#!forum/openolat</subscribe>
			<post>openolat@googlegroups.com</post>
			<archive>https://groups.google.com/forum/#!forum/openolat</archive>
bps's avatar
bps committed
		</mailingList>
	</mailingLists>
	<!-- Unless otherwise explicitly stated the character encoding for all resources 
		(e.g., source, test etc.) will be UTF-8. This can be overriden at the plugin 
		level if necessary. -->
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<org.springframework.version>3.2.4.RELEASE</org.springframework.version>
		<org.hibernate.version>4.2.8.Final</org.hibernate.version>
		<com.sun.jersey.version>1.17.1</com.sun.jersey.version>
		<jackson.version>1.9.2</jackson.version>
		<org.mysql.version>5.1.26</org.mysql.version>
		<org.postgresql.version>9.1-901.jdbc4</org.postgresql.version>
		<org.infinispan.version>5.2.7.Final</org.infinispan.version>
	    <!-- properties for testing and Q&A -->
	    <!-- by default no tests are executed so far (April 2011). Use appropriate profiles and properties on the command line -->
	    <skipTests>true</skipTests>
	    <skipITs>true</skipITs>
	    <!-- properties to define the testing environment -->
	    <test.env>mysql</test.env>
	    <!-- olat.local.properties to distinguish multiple single and cluster olat instances on a single machine-->
	    <test.env.db.name>olattest</test.env.db.name>
	    <test.env.db.user>olat</test.env.db.user>
	    <test.env.db.pass>olat</test.env.db.pass>
	    <test.env.db.host.port>3306</test.env.db.host.port>
	    <test.env.db.postgresql.user>postgres</test.env.db.postgresql.user>
	    <test.env.db.postgresql.pass>postgres</test.env.db.postgresql.pass>
	    <test.env.db.postgresql.host.port>5432</test.env.db.postgresql.host.port>
	    <test.env.instance.id>myolat</test.env.instance.id>
	    <test.env.jmx.rmi.port.0>3000</test.env.jmx.rmi.port.0>
bps's avatar
bps committed
	</properties>
	<profiles>
		<profile>
			<id>documentation</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.sun.tools.jxc.maven2</groupId>
						<artifactId>maven-jaxb-schemagen-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>com.sun.jersey.contribs</groupId>
						<artifactId>maven-wadl-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>xml-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>compressjs</id>
			<build>
				<plugins>
					<!-- Compress jquery plugins -->
					<plugin>
						<groupId>net.alchim31.maven</groupId>
						<artifactId>yuicompressor-maven-plugin</artifactId>
						<version>1.3.2</version>
						<executions>
							<execution>
								<id>compressjs</id>
								<phase>process-resources</phase>
								<goals>
									<goal>compress</goal>
								</goals>
								<configuration>
									<suffix>.min</suffix>
									<force>true</force>
									<encoding>UTF-8</encoding>
									<nocompress>false</nocompress>
									<outputDirectory>${basedir}/target/jquery</outputDirectory>
									<sourceDirectory>${basedir}/src/main/webapp/static/js</sourceDirectory>
									<aggregations>
										<aggregation>
											<output>${basedir}/src/main/webapp/static/js/js.plugins.min.js</output>
											<removeIncluded>false</removeIncluded>
											<includes>
												<include>${basedir}/target/jquery/functions.min.js</include>
												<include>${basedir}/target/jquery/jshashtable-2.1_src.min.js</include>
												<include>${basedir}/target/jquery/jquery/openolat/jquery.oolog.min.js</include>
												<include>${basedir}/target/jquery/jquery/openolat/jquery.translator.min.js</include>
												<include>${basedir}/target/jquery/jquery/periodic/jquery.periodic.min.js</include>
												<include>${basedir}/src/main/webapp/static/js/tinymce4/tinymce/jquery.tinymce.min.js</include>
											</includes>
										</aggregation>
										<aggregation>
											<output>${basedir}/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatmatheditor/plugin.min.js</output>
											<removeIncluded>false</removeIncluded>
											<includes>
												<include>${basedir}/target/jquery/tinymce4/tinymce/plugins/olatmatheditor/plugin.min.js</include>
											</includes>
										</aggregation>
										<aggregation>
											<output>${basedir}/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatmovieviewer/plugin.min.js</output>
											<removeIncluded>false</removeIncluded>
											<includes>
												<include>${basedir}/target/jquery/tinymce4/tinymce/plugins/olatmovieviewer/plugin.min.js</include>
											</includes>
										</aggregation>
										<aggregation>
											<output>${basedir}/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatsmileys/plugin.min.js</output>
											<removeIncluded>false</removeIncluded>
											<includes>
												<include>${basedir}/target/jquery/tinymce4/tinymce/plugins/olatsmileys/plugin.min.js</include>
											</includes>
										</aggregation>
										<aggregation>
											<output>${basedir}/src/main/webapp/static/js/tinymce4/tinymce/plugins/quotespliter/plugin.min.js</output>
											<removeIncluded>false</removeIncluded>
											<includes>
												<include>${basedir}/target/jquery/tinymce4/tinymce/plugins/quotespliter/plugin.min.js</include>
											</includes>
										</aggregation>
									</aggregations>
								</configuration>
							</execution>
							<execution>
								<id>compresscss</id>
								<phase>process-resources</phase>
								<goals>
									<goal>compress</goal>
								</goals>
								<configuration>
									<suffix>.min</suffix>
									<force>true</force>
									<encoding>UTF-8</encoding>
									<nocompress>false</nocompress>
									<outputDirectory>${basedir}/target/jquery</outputDirectory>
									<sourceDirectory>${basedir}/src/main/webapp/static/js</sourceDirectory>
									<aggregations>
										<aggregation>
											<output>${basedir}/src/main/webapp/static/js/js.plugins.min.css</output>
											<removeIncluded>false</removeIncluded>
											<includes>
												<include>${basedir}/target/jquery/jquery/tagit/jquery.tagit.min.css</include>
												<include>${basedir}/target/jquery/jquery/uilayout/layout-default-latest.min.css</include>
												<include>${basedir}/target/jquery/jquery/fullcalendar/fullcalendar.min.css</include>
												<include>${basedir}/src/main/webapp/static/js/jquery/datatables/css/jquery.dataTables.css</include>
												<include>${basedir}/src/main/webapp/static/yaml/core/slim_base.css</include>
											</includes>
										</aggregation>
									</aggregations>
								</configuration>
							</execution>
						</executions>
					</plugin>
		<!-- This is the default build which had all dependencies needed by tomcat -->
		<profile>
			<id>tomcat</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<dependencies>
				<!-- Jersey for tomcat -->
				<dependency>
					<groupId>javax.ws.rs</groupId>
					<artifactId>jsr311-api</artifactId>
					<version>1.1.1</version>
				</dependency>
				<dependency>
					<groupId>com.sun.jersey</groupId>
					<artifactId>jersey-server</artifactId>
					<version>${com.sun.jersey.version}</version>
					<exclusions>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring-core</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring-beans</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring-context</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring-web</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring-aop</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.springframework</groupId>
							<artifactId>spring-jca</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
				<dependency>
					<groupId>com.sun.jersey</groupId>
					<artifactId>jersey-servlet</artifactId>
					<version>${com.sun.jersey.version}</version>
				</dependency>
				
				<dependency>
					<groupId>dom4j</groupId>
					<artifactId>dom4j</artifactId>
					<version>1.6.1</version>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-core</artifactId>
					<version>${org.hibernate.version}</version>
					<exclusions>
						<exclusion>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-log4j12</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-entitymanager</artifactId>
					<version>${org.hibernate.version}</version>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-infinispan</artifactId>
					<version>${org.hibernate.version}</version>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-c3p0</artifactId>
					<version>${org.hibernate.version}</version>
				</dependency>
				
				<dependency>
					<groupId>org.infinispan</groupId>
					<artifactId>infinispan-core</artifactId>
					<version>${org.infinispan.version}</version>
					<exclusions>
						<exclusion>
							<groupId>org.jboss.spec.javax.transaction</groupId>
							<artifactId>jboss-transaction-api_1.1_spec</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.jboss.logging</groupId>
							<artifactId>jboss-logging</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.codehaus.woodstox</groupId>
							<artifactId>woodstox-core-asl</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.codehaus.woodstox</groupId>
							<artifactId>stax2-api</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.rhq.helpers</groupId>
							<artifactId>rhq-pluginAnnotations</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
		
				<dependency>
					<groupId>mysql</groupId>
					<artifactId>mysql-connector-java</artifactId>
					<version>${org.mysql.version}</version>
				</dependency>
				<dependency>
					<groupId>postgresql</groupId>
					<artifactId>postgresql</artifactId>
					<version>${org.postgresql.version}</version>
				</dependency>
		
				<dependency>
					<groupId>org.apache.geronimo.specs</groupId>
					<artifactId>geronimo-jms_1.1_spec</artifactId>
					<version>1.1.1</version>
				</dependency>
				<dependency>
					<groupId>org.apache.activemq</groupId>
					<artifactId>activemq-core</artifactId>
					<version>5.3.2</version>
					<exclusions>
						<exclusion>
							<groupId>backport-util-concurrent</groupId>
							<artifactId>backport-util-concurrent</artifactId>
						</exclusion>
						<exclusion>
							<groupId>javax.activation</groupId>
							<artifactId>activation</artifactId>
						</exclusion>
						<!-- fxdiff: FXOLAT-243  clean up the dependencies of ActiveMQ -->
						<exclusion>
							<groupId>org.springframework.osgi</groupId>
							<artifactId>spring-osgi-core</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.apache.activemq</groupId>
							<artifactId>kahadb</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.osgi</groupId>
							<artifactId>org.osgi.core</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.apache.geronimo.specs</groupId>
							<artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
						</exclusion>
						<exclusion>
							<groupId>commons-logging</groupId>
							<artifactId>commons-logging-api</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
				<!-- webservice stack -->
				<dependency>
	      			<groupId>com.sun.xml.ws</groupId>
	      			<artifactId>jaxws-rt</artifactId>
	      			<version>2.2.6</version>
	      			<exclusions>
	      				<exclusion>
	      					<groupId>javax.activation</groupId>
	      					<artifactId>activation</artifactId>
	      				</exclusion>
	      			</exclusions>
	    		</dependency>
	    		<dependency>
	    			<groupId>com.sun.xml.fastinfoset</groupId>
	    			<artifactId>FastInfoset</artifactId>
	    			<version>1.2.8</version>
	    		</dependency>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-war-plugin</artifactId>
						<configuration>
							<webResources>
								<resource>
									<directory>src/main/webapp</directory>
									<filtering>false</filtering>
								</resource>
								<resource>
									<directory>src/main/webapp-tomcat</directory>
									<filtering>false</filtering>
								</resource>
							</webResources>
						</configuration>
					</plugin>
				</plugins>
			</build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-war-plugin</artifactId>
						<configuration>
							<webResources>
								<resource>
									<directory>src/main/webapp-jbossas7</directory>
									<filtering>false</filtering>
								</resource>
								<resource>
									<directory>src/main/webapp</directory>
									<filtering>false</filtering>
								</resource>
							</webResources>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<profile>
			<id>gae</id>
			<dependencies>
				<dependency>
					<groupId>dom4j</groupId>
					<artifactId>dom4j</artifactId>
					<version>1.6.1</version>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-core</artifactId>
					<version>${org.hibernate.version}</version>
					<exclusions>
						<exclusion>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-log4j12</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-entitymanager</artifactId>
					<version>${org.hibernate.version}</version>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-infinispan</artifactId>
					<version>${org.hibernate.version}</version>
				</dependency>
				<dependency>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-c3p0</artifactId>
					<version>${org.hibernate.version}</version>
				</dependency>
		
				<dependency>
					<groupId>mysql</groupId>
					<artifactId>mysql-connector-java</artifactId>
					<version>${org.mysql.version}</version>
				</dependency>
				<dependency>
					<groupId>postgresql</groupId>
					<artifactId>postgresql</artifactId>
					<version>${org.postgresql.version}</version>
				</dependency>
		
				<dependency>
					<groupId>org.apache.activemq</groupId>
					<artifactId>activemq-core</artifactId>
					<version>5.3.2</version>
					<exclusions>
						<exclusion>
							<groupId>backport-util-concurrent</groupId>
							<artifactId>backport-util-concurrent</artifactId>
						</exclusion>
						<exclusion>
							<groupId>javax.activation</groupId>
							<artifactId>activation</artifactId>
						</exclusion>
						<!-- fxdiff: FXOLAT-243  clean up the dependencies of ActiveMQ -->
						<exclusion>
							<groupId>org.springframework.osgi</groupId>
							<artifactId>spring-osgi-core</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.apache.activemq</groupId>
							<artifactId>kahadb</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.osgi</groupId>
							<artifactId>org.osgi.core</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.apache.geronimo.specs</groupId>
							<artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
						</exclusion>
						<exclusion>
							<groupId>commons-logging</groupId>
							<artifactId>commons-logging-api</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
			</dependencies>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-war-plugin</artifactId>
						<configuration>
							<webResources>
								<resource>
									<directory>src/main/webapp</directory>
									<filtering>false</filtering>
								</resource>
								<resource>
									<directory>src/main/webapp-gae</directory>
									<filtering>false</filtering>
								</resource>
							</webResources>
						</configuration>
					</plugin>
				</plugins>
			</build>

    <profile>
      <id>mysqlunittests</id>
      <activation>
        <property>
          <name>with-mysql</name>
        </property>
      </activation>
      <properties>
        <skipTests>false</skipTests>
        <skipITs>true</skipITs>
        <testFailureIgnore>false</testFailureIgnore>
        <test.env>mysql</test.env>
      </properties>
      <build>
        <plugins>
          <plugin>
            <!-- Documentation: http://maven.apache.org/plugins/maven-surefire-plugin/ -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
              <argLine>-XX:MaxPermSize=128m -Xmx512m -Xms256m -Djava.awt.headless=true</argLine>
            	<systemPropertyVariables>
								<java.io.tmpdir>${project.build.directory}/olatdata</java.io.tmpdir>
							</systemPropertyVariables>
              <testNGArtifactName>none:none</testNGArtifactName>
              <includes>
                <include>org/olat/test/AllTestsJunit4.java</include>
              </includes>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.3</version>
            <executions>
              <execution>
                <id>copy-resources-4-mysqlunittests</id>
                <!-- hook in to copy maven.build.properties to allow test and integration-test phase run properly -->
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/test-classes</outputDirectory>
                  <resources>
                    <resource>
                      <!-- place resources you like to get filtered an copied -->
                      <directory>src/test/profile/${test.env}</directory>
                      <includes>
                        <include>olat.local.properties</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                    <resource>
                      <!-- place resources you like to get filtered an copied -->
                      <directory>src/main/resources/database/mysql</directory>
                      <includes>
                        <include>setupDatabase.sql</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>clean-mysql-dbsetup</id>
      <activation>
        <property>
          <name>with-mysql</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.3</version>
            <executions>
              <execution>
                <id>copy-resources-4-clean-mysql-dbsetup</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/test-classes</outputDirectory>
                  <resources>
                    <resource>
                      <!-- place resources you like to get filtered an copied -->
                      <directory>src/main/resources/database/mysql</directory>
                      <includes>
                        <include>setupDatabase.sql</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <version>1.4</version>

            <dependencies>
              <dependency>
                <!-- DO NOT UPDATE! -->
                <!-- Due to our special setup where we use the jdbc driver to convert 
				          from utf-8 to iso we cannot update this lib at the moment. -->
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${org.mysql.version}</version>
              </dependency>
            </dependencies>

            <!-- common configuration shared by all executions -->
            <configuration>
              <driver>com.mysql.jdbc.Driver</driver>
              <url>jdbc:mysql://localhost:${test.env.db.host.port}/${test.env.db.name}</url>
              <username>${test.env.db.user}</username>
              <password>${test.env.db.pass}</password>
              <!-- You can comment out username/password configurations and
                   have maven to look them up in your settings.xml using ${settingsKey}
              
              <settingsKey>sensibleKey</settingsKey>-->
              <!--all executions are ignored if -Dmaven.test.skip=true-->
              <skip>${maven.test.skip}</skip>
            </configuration>

            <executions>
              <execution>
                <id>drop-db-before-test</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <!-- need another database to drop the targeted one -->
                  <url>jdbc:mysql://localhost:${test.env.db.host.port}/olat</url>
                  <autocommit>true</autocommit>
                  <sqlCommand>drop database ${test.env.db.name}</sqlCommand>
                  <!-- ignore error when database is not avaiable -->
                  <onError>continue</onError>
                </configuration>
              </execution>

              <execution>
                <id>create-db</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <url>jdbc:mysql://localhost:${test.env.db.host.port}/olat</url>
                  <!-- no transaction -->
                  <autocommit>true</autocommit>
                  <sqlCommand>create database ${test.env.db.name} default character set utf8</sqlCommand>
                </configuration>
              </execution>

              <execution>
                <id>create-schema</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <autocommit>true</autocommit>
                  <srcFiles>
                    <srcFile>target/test-classes/setupDatabase.sql</srcFile>
                  </srcFiles>
                </configuration>
              </execution>
              <!-- drop db after test -->
              <execution>
                <id>drop-db-after-test</id>
                <!-- there is no post-test phase, the next phase after "test" is "prepare-package"
                     for integration tests running against mysql generated via setupDatabase.sql there is need
                     to bind a similar drop/create/schema/drop to pre-integration-test and post-integration-test -->
                <phase>prepare-package</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <autocommit>true</autocommit>
                  <sqlCommand>drop database ${test.env.db.name}</sqlCommand>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>postgresqlunittests</id>
      <activation>
        <property>
          <name>with-postgresql</name>
        </property>
      </activation>
      <properties>
        <skipTests>false</skipTests>
        <skipITs>true</skipITs>
        <testFailureIgnore>false</testFailureIgnore>
        <test.env>postgresql</test.env>
      </properties>
      <build>
        <plugins>
          <plugin>
            <!-- Documentation: http://maven.apache.org/plugins/maven-surefire-plugin/ -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
              <argLine>-XX:MaxPermSize=128m -Xmx512m -Xms256m -Djava.awt.headless=true</argLine>
            	<systemPropertyVariables>
								<java.io.tmpdir>${project.build.directory}/olatdata</java.io.tmpdir>
							</systemPropertyVariables>
              <testNGArtifactName>none:none</testNGArtifactName>
              <includes>
                <include>org/olat/test/AllTestsJunit4.java</include>
              </includes>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.3</version>
            <executions>
              <execution>
                <id>copy-resources-4-postgresqlunittests</id>
                <!-- hook in to copy maven.build.properties to allow test and integration-test phase run properly -->
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/test-classes</outputDirectory>
                  <resources>
                    <resource>
                      <!-- place resources you like to get filtered an copied -->
                      <directory>src/test/profile/${test.env}</directory>
                      <includes>
                        <include>olat.local.properties</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                    <resource>
                      <!-- place resources you like to get filtered an copied -->
                      <directory>src/main/resources/database/postgresql</directory>
                      <includes>
                        <include>setupDatabase.sql</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>clean-postgresql-dbsetup</id>
      <activation>
        <property>
          <name>with-postgresql</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.3</version>
            <executions>
              <execution>
                <id>copy-resources-4-clean-postgresql-dbsetup</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/test-classes</outputDirectory>
                  <resources>
                    <resource>
                      <!-- place resources you like to get filtered an copied -->
                      <directory>src/main/resources/database/postgresql</directory>
                      <includes>
                        <include>setupDatabase.sql</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <version>1.5</version>

            <dependencies>
              <dependency>
			          <groupId>postgresql</groupId>
			          <artifactId>postgresql</artifactId>
			          <version>8.4-701.jdbc4</version>
		          </dependency>
            </dependencies>

            <!-- common configuration shared by all executions -->
            <configuration>
              <driver>org.postgresql.Driver</driver>
              <url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/${test.env.db.name}</url>
              <username>${test.env.db.postgresql.user}</username>
              <password>${test.env.db.postgresql.pass}</password>
              <!-- You can comment out username/password configurations and
                   have maven to look them up in your settings.xml using ${settingsKey}
              
              <settingsKey>sensibleKey</settingsKey>-->
              <!--all executions are ignored if -Dmaven.test.skip=true-->
              <skip>${maven.test.skip}</skip>
            </configuration>

            <executions>
              <execution>
                <id>drop-db-before-test</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <!-- need another database to drop the targeted one -->
                  <url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
                  <autocommit>true</autocommit>
                  <sqlCommand>drop database ${test.env.db.name}</sqlCommand>
                  <!-- ignore error when database is not avaiable -->
                  <onError>continue</onError>
                </configuration>
              </execution>

              <execution>
                <id>create-db</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
                  <!-- no transaction -->
                  <autocommit>true</autocommit>
                  <sqlCommand>create database ${test.env.db.name}</sqlCommand>
                </configuration>
              </execution>

              <execution>
                <id>create-schema</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <autocommit>true</autocommit>
                  <srcFiles>
                    <srcFile>target/test-classes/setupDatabase.sql</srcFile>
                  </srcFiles>
                </configuration>
              </execution>

              <!-- drop db after test -->
              <execution>
                <id>drop-db-after-test</id>
                <!-- there is no post-test phase, the next phase after "test" is "prepare-package"
                     for integration tests running against mysql generated via setupDatabase.sql there is need
                     to bind a similar drop/create/schema/drop to pre-integration-test and post-integration-test -->
                <phase>prepare-package</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
                  <autocommit>true</autocommit>
                  <sqlCommand>drop database ${test.env.db.name}</sqlCommand>
                </configuration>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>
    
	<profile>
		<id>oracleunittests</id>
		<activation>
			<property>
				<name>with-oracle</name>
			</property>
		</activation>
		<properties>
			<skipTests>false</skipTests>
			<skipITs>true</skipITs>
			<testFailureIgnore>false</testFailureIgnore>
			<test.env>oracle</test.env>
		</properties>
		<build>
			<plugins>
				<plugin>
					<!-- Documentation: http://maven.apache.org/plugins/maven-surefire-plugin/ -->
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.8.1</version>
					<configuration>
						<argLine>-XX:MaxPermSize=128m -Xmx512m -Xms256m -Djava.awt.headless=true</argLine>
						<systemPropertyVariables>
							<java.io.tmpdir>${project.build.directory}/olatdata</java.io.tmpdir>
						</systemPropertyVariables>
						<testNGArtifactName>none:none</testNGArtifactName>
						<includes>
							<include>org/olat/test/AllTestsJunit4.java</include>
						</includes>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>2.4.3</version>
					<executions>
						<execution>
							<id>copy-resources-4-postgresqlunittests</id>
							<!-- hook in to copy maven.build.properties to allow test and integration-test 
								phase run properly -->
							<phase>generate-test-resources</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${basedir}/target/test-classes</outputDirectory>
								<resources>