
<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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.ancoron.postgresql</groupId>
        <artifactId>pginet-parent</artifactId>
        <version>8.4.702.jdbc4.1-rc6</version>
    </parent>

    <artifactId>org.postgresql.net</artifactId>
    <packaging>jar</packaging>

    <name>PostgreSQL Network Types Extension OSGi Bundle</name>

    <description>
        This OSGi bundle contains classes that can be used directly within a JDBC enabled application to support direct mapping of the PostgreSQL specific data types 'inet', 'cidr' and 'macaddr'. The source code is provided by the original author Russell Francis.
    </description>

    <dependencies>
        <dependency>
            <groupId>org.ancoron.postgresql</groupId>
            <artifactId>org.postgresql</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>test-util</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        <manifestEntries>
                            <Built-By>ancoron</Built-By>
                            <PostgreSQL-Driver>${postgresql.version}</PostgreSQL-Driver>
                        </manifestEntries>
                    </archive> 
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>
                            org.postgresql.net*
                        </Export-Package>
                        <Import-Package>
                            org.postgresql*;version="[\$(version;====;\$(@)),\$(version;====;\$(@))]",
                            *
                        </Import-Package>
                        <Bundle-License>http://jdbc.postgresql.org/license.html</Bundle-License>
                        <Original-Author>Russel Francis &lt;russ@metro-six.com&gt;</Original-Author>
                        <Bundle-DocURL>http://www.metro-six.com/products/labs/pg-inet-types</Bundle-DocURL>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>    
                            <goal>manifest</goal>
                        </goals>   
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <executions>
                    <execution>
                        <id>export-original</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>checkout</goal>
                        </goals>
                        <configuration>
                            <checkoutDirectory>${project.build.directory}/upstream</checkoutDirectory>
                            <connectionUrl>scm:hg:https://hg.metro-six.com/public/pg-inet-types</connectionUrl>
                            <developerConnectionUrl />
                            <pushChanges>false</pushChanges>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-patch-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bugfixing</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>apply</goal>
                        </goals>
                        <configuration>
                            <skipApplication>false</skipApplication>
                            <patchDirectory>src/main/patches</patchDirectory>
                            <optimizations>false</optimizations>
                            <naturalOrderProcessing>true</naturalOrderProcessing>
                            <targetDirectory>${project.build.directory}/upstream/src/main/java</targetDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-upstream-sources</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/upstream/src/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-upstream-resources</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/upstream</directory>
                                    <includes>
                                        <include>LICENSE.TXT</include>
                                    </includes>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-upstream-test</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/upstream/src/unittests/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/TestUtil</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <java.util.logging.config.file>${project.build.testOutputDirectory}/logging.properties</java.util.logging.config.file>
                        <pgsql.host>${pgsql.host}</pgsql.host>
                        <pgsql.port>${pgsql.port}</pgsql.port>
                        <pgsql.database>${pgsql.database}</pgsql.database>
                        <pgsql.user>${pgsql.user}</pgsql.user>
                        <pgsql.password>${pgsql.password}</pgsql.password>
                        <pgsql.ssl>${pgsql.ssl}</pgsql.ssl>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
