Newer
Older
<?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>
<url>http://www.openolat.org</url>
Welcome to the OpenOLAT (Open Online Learning And Training) Developer Project Site. This site
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>
</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.
</comments>
</license>
</licenses>
<distributionManagement>
<repository>

srosse
committed
<id>nexus.openolat</id>
<name>OpenOLAT Internal Nexus Release Repository</name>

srosse
committed
<url>http://nexus.openolat.org/nexus/content/repositories/openolat</url>

srosse
committed
<id>nexus.openolat</id>
<name>OpenOLAT Internal Nexus Snapshot Repository</name>

srosse
committed
<url>http://nexus.openolat.org/nexus/content/repositories/openolat-snapshots</url>
</snapshotRepository>
</distributionManagement>
<issueManagement>
<system>JIRA</system>
<url>http://jira.openolat.org</url>
<connection>scm:hg:http://hg.openolat.org</connection>
<developerConnection>scm:hg:http://hg.openolat.org</developerConnection>
<url>http://hg.openolat.org</url>
<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>
</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.14.RELEASE</org.springframework.version>
<org.hibernate.version>4.3.10.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.36</org.mysql.version>

srosse
committed
<org.postgresql.version>9.4-1201-jdbc41</org.postgresql.version>
<lucene.version>4.8.0</lucene.version>
<version.selenium>2.47.1</version.selenium>
<activemq.version>5.11.1</activemq.version>
<qtiworks.version>1.0-SNAPSHOT</qtiworks.version>

srosse
committed
<!-- 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 -->
<!-- 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>
<skipTests>true</skipTests>
<skipSeleniumTests>false</skipSeleniumTests>
<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>compressbootstrap</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/bootstrap</outputDirectory>
<sourceDirectory>${basedir}/src/main/webapp/static/bootstrap</sourceDirectory>
<excludeResources>true</excludeResources>
<aggregations>
<aggregation>
<output>${basedir}/target/bootstrap/bootstrap-openolat.min.js</output>
<removeIncluded>false</removeIncluded>
<includes>
<!-- <include>${basedir}/target/bootstrap/javascripts/bootstrap/affix.min.js</include> -->
<include>${basedir}/target/bootstrap/javascripts/bootstrap/alert.min.js</include>
<include>${basedir}/target/bootstrap/javascripts/bootstrap/button.min.js</include>
<!-- <include>${basedir}/target/bootstrap/javascripts/bootstrap/carousel.min.js</include> -->
<include>${basedir}/target/bootstrap/javascripts/bootstrap/collapse.min.js</include>
<include>${basedir}/target/bootstrap/javascripts/bootstrap/dropdown.min.js</include>
<include>${basedir}/target/bootstrap/javascripts/bootstrap/tab.min.js</include>
<include>${basedir}/target/bootstrap/javascripts/bootstrap/transition.min.js</include>
<!-- <include>${basedir}/target/bootstrap/javascripts/bootstrap/scrollspy.min.js</include> -->
<include>${basedir}/target/bootstrap/javascripts/bootstrap/modal.min.js</include>
<include>${basedir}/target/bootstrap/javascripts/bootstrap/tooltip.min.js</include>
<include>${basedir}/target/bootstrap/javascripts/bootstrap/popover.min.js</include>
</includes>
</aggregation>
</aggregations>
</configuration>
</execution>
<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>
<excludeResources>true</excludeResources>
<aggregations>
<aggregation>
<output>${basedir}/src/main/webapp/static/js/js.plugins.min.js</output>
<removeIncluded>false</removeIncluded>
<includes>
<include>${basedir}/target/jquery/jquery/periodic/jquery.periodic.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>

srosse
committed
<include>${basedir}/target/jquery/jquery/openolat/jquery.navbar.min.js</include>

kscherer
committed
<include>${basedir}/target/jquery/jquery/openolat/jquery.bgcarrousel.min.js</include>
<include>${basedir}/src/main/webapp/static/js/tinymce4/tinymce/jquery.tinymce.min.js</include>
<include>${basedir}/target/jquery/functions.min.js</include>
<include>${basedir}/target/jquery/jquery/transit/jquery.transit.min.js</include>
<include>${basedir}/target/bootstrap/bootstrap-openolat.min.js</include>
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
</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>
<aggregation>
<output>${basedir}/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.min.js</output>
<removeIncluded>false</removeIncluded>
<includes>
<include>${basedir}/target/jquery/jquery/openolat/jquery.statistics.chart.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>
<excludeResources>true</excludeResources>
<aggregations>
<aggregation>
<output>${basedir}/src/main/webapp/static/js/js.plugins.min.css</output>
<removeIncluded>false</removeIncluded>
<includes>
<include>${basedir}/target/jquery/jquery/tagsinput/bootstrap-tagsinput.min.css</include>
<include>${basedir}/target/jquery/jquery/fullcalendar/fullcalendar.min.css</include>
<include>${basedir}/target/jquery/jquery/cropper/cropper.min.css</include>
<include>${basedir}/target/jquery/jquery/ui/jquery-ui-1.11.4.custom.min.css</include>
</includes>
</aggregation>
</aggregations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- This is the default build which had all dependencies needed by tomcat -->
<profile>
<id>tomcat</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<!-- 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-hikaricp</artifactId>
<version>${org.hibernate.version}</version>
</dependency>
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<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>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${org.mysql.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${org.postgresql.version}</version>
<exclusions>
<exclusion>
<groupId>com.github.dblock.waffle</groupId>
<artifactId>waffle-jna</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</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-client</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>${activemq.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.0.1B_spec</artifactId>
</exclusion>
<exclusion>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</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>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp-tomcat</directory>
<filtering>false</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>

srosse
committed
<id>wildfly</id>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>${com.sun.jersey.version}</version>
<scope>test</scope>
</dependency>
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${org.hibernate.version}</version>
<scope>provided</scope>
<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>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-infinispan</artifactId>
<version>${org.hibernate.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>${org.infinispan.version}</version>
<scope>provided</scope>
<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>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${org.mysql.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${org.postgresql.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>

srosse
committed
<directory>src/main/webapp-wildfly</directory>
<filtering>false</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>mysqlunittests</id>
<activation>
<property>
<name>with-mysql</name>
</property>
</activation>
<properties>
<testFailureIgnore>false</testFailureIgnore>
<test.env>mysql</test.env>
<skipTests>false</skipTests>
</properties>
<build>
<plugins>
<plugin>
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>copy-resources-4-mysqlunittests</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/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>

srosse
committed
<filtering>false</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>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>
</configuration>
<executions>
<execution>
<id>drop-mysql-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 if exists ${test.env.db.name}</sqlCommand>
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
<!-- ignore error when database is not avaiable -->
<onError>continue</onError>
</configuration>
</execution>
<execution>
<id>create-mysql-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-mysql-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-mysql-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 if exists ${test.env.db.name}</sqlCommand>
</configuration>
</execution>
<!-- Same for integration-test -->
<execution>
<id>drop-mysql-db-before-integration</id>
<phase>pre-integration-test</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 if exists ${test.env.db.name}</sqlCommand>
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
<!-- ignore error when database is not avaiable -->
<onError>continue</onError>
</configuration>
</execution>
<execution>
<id>create-mysql-db-before-integration-test</id>
<phase>pre-integration-test</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-mysql-schema-before-integration-test</id>
<phase>pre-integration-test</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-mysql-db-after-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<autocommit>true</autocommit>
<sqlCommand>drop database if exists ${test.env.db.name}</sqlCommand>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
</build>
</profile>
<profile>
<id>postgresqlunittests</id>
<activation>
<property>
<name>with-postgresql</name>
</property>
</activation>
<properties>
<testFailureIgnore>false</testFailureIgnore>
<test.env>postgresql</test.env>
<skipTests>false</skipTests>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>copy-resources-4-postgresqlunittests</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/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>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${org.postgresql.version}</version>
<exclusions>
<exclusion>
<groupId>com.github.dblock.waffle</groupId>
<artifactId>waffle-jna</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</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>
</configuration>
<executions>
<execution>
<id>drop-postgresql-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 if exists ${test.env.db.name}</sqlCommand>
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
<!-- ignore error when database is not avaiable -->
<onError>continue</onError>
</configuration>
</execution>
<execution>
<id>create-postgresql-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-postgresql-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-postgresql-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 if exists ${test.env.db.name}</sqlCommand>
</configuration>
</execution>
<!-- Same for integration tests -->
<execution>
<id>drop-postgresql-db-before-integtration-test</id>
<phase>pre-integration-test</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 if exists ${test.env.db.name}</sqlCommand>
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
<!-- ignore error when database is not avaiable -->
<onError>continue</onError>
</configuration>
</execution>
<execution>
<id>create-postgresql-db-before-integration-test</id>
<phase>pre-integration-test</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-postgresql-schema-before-integration-test</id>
<phase>pre-integration-test</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-postgresql-db-after-integration-test</id>
<phase>post-integration-test</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 if exists ${test.env.db.name}</sqlCommand>
</configuration>
</execution>
</executions>