<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
	license agreements. See the NOTICE file distributed with this work for additional 
	information regarding copyright ownership. The ASF licenses this file to 
	You under the Apache License, Version 2.0 (the "License"); you may not use 
	this file except in compliance with the License. You may obtain a copy of 
	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
	by applicable law or agreed to in writing, software distributed under the 
	License 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. -->
<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">
    <parent>
        <artifactId>fulcrum-security</artifactId>
        <groupId>org.apache.fulcrum</groupId>
        <version>2.1.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>fulcrum-security-torque</artifactId>
    <name>Fulcrum Security Torque Impl</name>
    <description>
    Fulcrum Security Torque Impl is an implementation of the Fulcrum Security API
    that uses Apache DB Torque as a database backend.
    </description>
    <url>https://turbine.apache.org/fulcrum/fulcrum-security/fulcrum-security-torque</url>
    
    <scm>
      <url>https://github.com/apache/${turbine.site.path}/tree/${project.scm.tag}/torque</url>
      <tag>fulcrum-security-2.1.0-candidate</tag>
  </scm>

    <properties>
        <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- Easy update of torque libs -->
        <torque.version>5.0</torque.version>
        <torque.om>org.apache.fulcrum.security.torque.om</torque.om>
        <torque.om.path>org/apache/fulcrum/security/torque/om</torque.om.path>
    </properties>
    <build>
        <sourceDirectory>src/java</sourceDirectory>
        <testSourceDirectory>src/test</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/test</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                        <!--default setting is forkCount=1/reuseForks=true -->
                        <reuseForks>false</reuseForks>
                        <forkCount>1</forkCount>
                   </configuration>
            </plugin>
           
        </plugins>
    </build>

     <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
              <show>public</show>
            </configuration>
          </plugin>
        </plugins>
      </reporting>


    <dependencies>
        <dependency>
            <groupId>org.apache.fulcrum</groupId>
            <artifactId>fulcrum-security-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.torque</groupId>
            <artifactId>torque-runtime</artifactId>
            <version>${torque.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.fulcrum</groupId>
            <artifactId>fulcrum-security-api</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.5.1</version>
            <!--version>1.8.0.10</version-->
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <version>2.9.0</version>
        </dependency>

        <!-- testing dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.fulcrum</groupId>
            <artifactId>fulcrum-testcontainer</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.fulcrum</groupId>
            <artifactId>fulcrum-yaafi</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>torque-generate-off</id>
        </profile>
        <profile>
            <id>torque-generate</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.torque</groupId>
                        <artifactId>torque-maven-plugin</artifactId>
                        <version>${torque.version}</version>
                        <executions>
                            <execution>
                                <id>torque-om</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.om</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>mysql</torque.database>
                                        <torque.om.package>${torque.om}</torque.om.package>
                                        <torque.om.addGetByNameMethods>false</torque.om.addGetByNameMethods>
                                        <torque.om.save.saveException>TorqueException</torque.om.save.saveException>
                                        <torque.om.useIsForBooleanGetters>true</torque.om.useIsForBooleanGetters>
                                    </options>
                                    <outputDirMap>
                                        <modifiable>${project.build.sourceDirectory}</modifiable>
                                    </outputDirMap>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-sql-mysql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.sql</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/mysql</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>mysql</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-sql-hsqldb</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.sql</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/hsqldb</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>hsqldb</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-sql-derby</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.sql</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/derby</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>derby</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-sql-oracle</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.sql</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/oracle</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>oracle</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-sql-postgresql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.sql</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/postgresql</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>postgresql</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-sql-mssql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.sql</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/mssql</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>mssql</torque.database>
                                    </options>
                                </configuration>
                            </execution>

                            <execution>
                                <id>torque-idtable-mysql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.idtable</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/mysql</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>mysql</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-idtable-hsqldb</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.idtable</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/hsqldb</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>hsqldb</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-idtable-derby</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.idtable</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/derby</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>derby</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-idtable-oracle</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.idtable</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/oracle</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>oracle</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-idtable-postgresql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.idtable</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/postgresql</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>postgresql</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                            <execution>
                                <id>torque-idtable-mssql</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <packaging>classpath</packaging>
                                    <configPackage>org.apache.torque.templates.idtable</configPackage>
                                    <sourceDir>${project.basedir}/schema</sourceDir>
                                    <defaultOutputDir>${project.build.directory}/generated-sql/torque/mssql</defaultOutputDir>
                                    <defaultOutputDirUsage>none</defaultOutputDirUsage>
                                    <loglevel>error</loglevel>
                                    <options>
                                        <torque.database>mssql</torque.database>
                                    </options>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.torque</groupId>
                                <artifactId>torque-templates</artifactId>
                                <version>${torque.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin><!-- clean up for torque-generate sources mysql -->
                        <artifactId>maven-clean-plugin</artifactId>
                        <configuration>
                            <filesets>
                                <fileSet>
                                    <directory>${project.build.sourceDirectory}/${torque.om.path}</directory>
                                    <excludes><!-- no peer interface configurable in Torque 4.0 -->
                                        <exclude>TurbineUserPeerImpl.java</exclude>
                                        <exclude>TurbineGroupPeerImpl.java</exclude>
                                        <exclude>TurbineRolePeerImpl.java</exclude>
                                        <exclude>TurbinePermissionPeerImpl.java</exclude>
                                        <exclude>TurbineUserGroupRolePeerImpl.java</exclude>
                                        <exclude>TorqueTurbineUserGroupRolePeerImpl.java</exclude>
                                        <exclude>TorqueTurbineUserGroupRole.java</exclude>
                                        <exclude>TorqueTurbineRolePermission.java</exclude>
                                    </excludes>
                                </fileSet>
                            </filesets>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
