<?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 https://maven.apache.org/maven-v4_0_0.xsd">
    <parent>
        <groupId>org.apache.torque</groupId>
        <artifactId>torque</artifactId>
        <version>8.0-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>torque-templates</artifactId>
    <packaging>jar</packaging>
    <name>Torque Templates</name>

    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/db/torque/trunk/tags/torque-7.0/trunk</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/db/torque/trunk/tags/torque-7.0/trunk
        </developerConnection>
        <url>http://svn.apache.org/viewvc/db/torque/trunk/tags/torque-7.0/trunk</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.apache.torque</groupId>
            <artifactId>torque-generator</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.torque</groupId>
            <artifactId>torque-runtime</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.derby</groupId>
          <artifactId>derby</artifactId>
          <scope>test</scope>
        </dependency>
        <!--dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbyshared</artifactId>
             <scope>test</scope>
        </dependency-->
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbytools</artifactId>
             <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>derby.stream.error.file</name>
                            <value>target/derby.log</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>${basedir}/../src/main/checkstyle/checkstyle.xml</configLocation>
                    <headerLocation>${basedir}/../src/main/checkstyle/license-header.txt</headerLocation>
                    <suppressionsLocation>${basedir}/../src/main/checkstyle/checkstyle-suppressions.xml
                    </suppressionsLocation>
                    <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <configuration>
                    <suppressionFiles>
                        <suppressionFile>${project.parent.basedir}/suppression-owasp-fp.xml</suppressionFile>
                    </suppressionFiles>
                </configuration>
            </plugin>      
        </plugins>
    </build>


    <profiles>
        <profile>
            <id>apache-release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>../src/main/assembly/bin-with-dependencies.xml</descriptor>
                            </descriptors>
                            <tarLongFileMode>gnu</tarLongFileMode>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
         <profile>
            <id>compile-generated-sources</id>
            <build>
                <plugins>
                   <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                      <execution>
                        <phase>integration-test</phase>
                        <goals>
                          <goal>testCompile</goal>
                        </goals>
                      </execution>
                    </executions>
                  </plugin>
                  <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <executions>
		                  <!--execution>
		                    <id>add-generated-resources</id>
		                    <phase>pre-integration-test</phase>
		                    <goals>
		                      <goal>add-test-resource</goal>
		                    </goals>
		                    <configuration>
		                      <resources>
		                           <resource>
		                               <directory>${project.build.directory}/generated-sources</directory>
		                               <targetPath>${project.build.directory}/generated-classes</targetPath>
		                          </resource>
		                          <resource>
		                               <directory>${project.build.directory}/generated-sources-2</directory>
		                               <targetPath>${project.build.directory}/generated-classes-2</targetPath>
		                          </resource>
 	                           </resources>
		                    </configuration>
		                  </execution-->
                          <execution>
                            <id>add-generated-sources</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                              <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                              <sources>
                                  <source>${project.build.directory}/generated-sources</source>
                                  <source>${project.build.directory}/generated-sources-2</source>
                               </sources>
                            </configuration>
                          </execution>
		                </executions>
		              </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
