<?xml version="1.0" encoding="UTF-8"?>

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

<!-- 
 @@@ START COPYRIGHT @@@                                                       

 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.

 @@@ END COPYRIGHT @@@
-->

  <modelVersion>4.0.0</modelVersion>
  <!--<parent>
    <groupId>org.apache.trafodion</groupId>
    <artifactId>trafodion</artifactId>
    <version>1.3.0</version>
	<relativePath>../../../</relativePath>
  </parent>-->
  <groupId>org.apache.trafodion.jdbc.t4</groupId>
  <artifactId>jdbcT4</artifactId>
  <version>${env.TRAFODION_VER}</version> 
  <name>Trafodion JDBC Type4 Driver</name>
  <url>http://wiki.trafodion.org</url>
  
<distributionManagement>
  <snapshotRepository>
    <id>apache.snapshots.https</id>
    <url>https://repository.apache.org/content/repositories/snapshots</url>
  </snapshotRepository>
  <repository>
    <id>apache.releases.https</id>
    <url>https://repository.apache.org/service/local/staging/deploy/maven2</url>
  </repository>
</distributionManagement>
 
 <scm>
    <connection>scm:git:https://github.com/apache/incubator-trafodion.git</connection>
    <developerConnection>scm:git:https://github.com/apache/incubator-trafodion.git</developerConnection>
    <url>https://github.com/apache/incubator-trafodion.git</url>
    <tag>HEAD</tag>
  </scm>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
	<dependency>
            <groupId>org.slf4j</groupId>
	    <artifactId>slf4j-simple</artifactId>
	    <version>1.7.21</version>
	    <scope>test</scope>
	</dependency>
  </dependencies>

  <build>
    <resources>
     <resource>
       <directory>src/main/java</directory>
       <includes>
         <include> **/*.properties</include>
       </includes>
     </resource>
     <resource>
       <directory>src/main/resources</directory>
       <includes>
         <include> **/NOTICE</include>
         <include> **/LICENSE</include>
       </includes>
     </resource>
    </resources>

   <plugins>

    <plugin>
     <artifactId>maven-antrun-plugin</artifactId>
     <version>1.8</version>
     <executions>
      <execution>
        <phase>generate-sources</phase>
        <configuration>
          <tasks>
            <copy file="src/main/java/org/trafodion/jdbc/t4/Vproc.java-tmpl" tofile="src/main/java/org/trafodion/jdbc/t4/Vproc.java"/>
            <copy file="NOTICE" todir="src/main/resources/META-INF"/>
            <copy file="LICENSE" todir="src/main/resources/META-INF"/>
            <replace token= "@@@@" 
                value="Traf_JDBC_Type4_Build_${bldId}"
                file="src/main/java/org/trafodion/jdbc/t4/Vproc.java">
            </replace>
          </tasks>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
       </execution>
     </executions>
    </plugin>

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>properties-maven-plugin</artifactId>
      <version>1.0.0</version>
      <executions>
        <execution>
           <phase>initialize</phase>
           <goals>
              <goal>read-project-properties</goal>
           </goals>
           <configuration>
             <files>
                <file>${basedir}/../../sqf/export/include/SCMBuildMan.mf</file>
                <file>${basedir}/../../sqf/export/include/buildId</file>
             </files>
            </configuration>
         </execution>
       </executions>
    </plugin>

    <plugin>
       <artifactId>maven-clean-plugin</artifactId>
       <version>2.4.1</version>
       <configuration>
         <filesets>
           <fileset>
             <directory>src/main/java/org/trafodion/jdbc/t4</directory>
             <includes>
                <include>**/Vproc.java</include>
             </includes>
          </fileset>
         </filesets>
        </configuration>
    </plugin>

    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
     <version>2.4</version>
     <configuration>
      <archive>
        <manifest>
          <mainClass>org.trafodion.jdbc.t4.Vproc</mainClass>
          <classpathPrefix>dependency-jars/</classpathPrefix>
	</manifest>
        <manifestEntries>
            <Implementation-Version-1>Version ${project.version}</Implementation-Version-1> 
            <Implementation-Version-2>${TRAFODION_VER_PROD} Release ${project.version}</Implementation-Version-2>
            <Implementation-Version-3>${Implementation-Version-3}</Implementation-Version-3>
            <Implementation-Version-4>${Implementation-Version-4}</Implementation-Version-4>
            <Implementation-Version-5>${Implementation-Version-5}</Implementation-Version-5>
            <Implementation-Version-6>${Implementation-Version-6}</Implementation-Version-6>
            <Product-Name>${project.name}</Product-Name>
        </manifestEntries>
      </archive>
     </configuration>
    </plugin>
    
    <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>2.5.3</version>
      <configuration>
          <descriptor>src/assembly/all.xml</descriptor>
          <appendAssemblyId>false</appendAssemblyId>
      </configuration>
      <executions>
        <execution>
          <id>create-archive</id>
          <phase>package</phase>
          <goals>
              <goal>single</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-dependency-plugin</artifactId>
     <version>2.5.1</version>
     <executions>
      <execution>
        <id>copy-dependencies</id>
        <phase>package</phase>
	<goals>
          <goal>copy-dependencies</goal>
	</goals>
	<configuration>
	  <outputDirectory>
            ${project.build.directory}/dependency-jars/
          </outputDirectory>
	</configuration>
      </execution>
     </executions>
    </plugin>
   </plugins>
  </build>
<profiles>
	<profile>
      <id>apache-release</id>
      <activation>
		<property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
		<plugins>
		<plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-release-plugin</artifactId>
                 <version>2.5</version>
                 <configuration>
                   <autoVersionSubmodules>true</autoVersionSubmodules>
                   <useReleaseProfile>false</useReleaseProfile>
                   <releaseProfiles>apache-release</releaseProfiles>
                   <goals>deploy</goals>
                 </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

		<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
				<phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>
  </profiles>
</project>
