
<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>9.1.901.jdbc4.1-rc4</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-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>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <id>initialize</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <!--
                <file>
                    <missing>src/main/java/org/postgresql/net/PGNetworkBase.java</missing>
                </file>
                -->
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-clean-plugin</artifactId>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>${project.build.sourceDirectory}</directory>
                                </fileset>
                                <fileset>
                                    <directory>${project.build.testSourceDirectory}</directory>
                                    <includes>
                                        <include>**/PGcidrTest.java</include>
                                        <include>**/PGinetTest.java</include>
                                        <include>**/PGmacaddrTest.java</include>
                                    </includes>
                                    <excludes>
                                        <exclude>**/TestUtil.java</exclude>
                                    </excludes>
                                    <followSymlinks>false</followSymlinks>
                                </fileset>
                            </filesets>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>export-original-inplace</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-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-upstream</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <overwrite>true</overwrite>
                                    <outputDirectory>${project.build.sourceDirectory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${project.build.directory}/upstream/src/main/java</directory>
                                            <includes>
                                                <include>**/*.java</include>
                                            </includes>
                                            <filtering>false</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-upstream-resources</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <overwrite>true</overwrite>
                                    <outputDirectory>src/main/resources</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${project.build.directory}/upstream</directory>
                                            <includes>
                                                <include>LICENSE.TXT</include>
                                            </includes>
                                            <filtering>false</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>copy-upstream-test</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <overwrite>true</overwrite>
                                    <outputDirectory>${project.build.testSourceDirectory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${project.build.directory}/upstream/src/unittests/java</directory>
                                            <includes>
                                                <include>**/*.java</include>
                                            </includes>
                                            <filtering>false</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!--
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-patch-plugin</artifactId>
                        <version>1.1.1</version>
                        <configuration>
                            <targetDirectory>${project.build.sourceDirectory}</targetDirectory>
                            <skipApplication>false</skipApplication>
                        </configuration>
                        <executions>
                            <execution>
                                <id>bugfixing</id>
                                <configuration>
                                    <patchDirectory>src/main/patches</patchDirectory>
                                    <optimizations>false</optimizations>
                                    <naturalOrderProcessing>true</naturalOrderProcessing>
                                </configuration>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>apply</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    -->
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
