[Pljava-dev] Building pljava.so with maven-nar-plugin?

From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] Building pljava.so with maven-nar-plugin?
Date: 2013-02-06 07:53:11
Message-ID: 51120BE7.6020109@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev


On 2013-02-06 02:31, Christian Hammers wrote:
> Hello
>
> I played around with the maven-nar-plugin that was recommended on this
> list. The below pom.xml does produce .h files from the java classes and
> also compiles the C files. What's missing though is a way to get a
> .h from "java.sql.Types" as this class is in the JRE's rt.jar and not
> in the specified <classDirectory>. Any ideas?
Not sure why that matters. Executing:

javah java.sql.Types

without giving it a classpath does produce the java_sql_Types.h file
without problems. Is the current javah configuration deliberately
stripping off the java runtime?

- thomas

> bye,
>
> -christian-
>
> P.S.: Beware the hardcoded paths and Postgres version numbers. Don't
> know yet how to integrate pg_config in maven.
>
> P.P.S.: Directoy layout for the C files is:
>
> ./src/main
> ./src/main/c
> ./src/main/c/type
> ./src/main/include
> ./src/main/include/pljava
> ./src/main/include/pljava/type
>
>
> <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.postgresql</groupId>
> <artifactId>pljava.app</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> </parent>
> <artifactId>pljava-so</artifactId>
> <name>pl/java server side library</name>
> <description>Generates the pljava.so library which gets loaded by
> the PostgreSQL server.</description> <packaging>nar</packaging>
>
> <build>
> <pluginManagement>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-nar-plugin</artifactId>
> <version>2.1-SNAPSHOT</version>
> </plugin>
> </plugins>
> </pluginManagement>
>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-nar-plugin</artifactId>
> <extensions>true</extensions>
>
> <configuration>
>
> <javah>
> <classPaths>
> <classPath>/srv/home/james/workspace/pljava/lathspell-master/pljava-jdbc/target/classes/</classPath>
> <classPath>/srv/home/james/workspace/pljava/lathspell-master/pljava-api/target/classes/</classPath>
> </classPaths>
> <classDirectory>/srv/home/james/workspace/pljava/lathspell-master/pljava-jdbc/target/classes/</classDirectory>
> <includes>
> <include>org/postgresql/**/*.class</include>
> <include>java/sql/Types.class</include>
> </includes>
> </javah>
>
> <libraries>
> <library>
> <type>shared</type>
> </library>
> </libraries>
>
> <c>
> <defines>
> <define>PKGLIBDIR="target/lib/"</define>
> <define>PGSQL_MAJOR_VER=9</define>
> <define>PGSQL_MINOR_VER=2</define>
> <define>PGSQL_PATCH_VER=0</define>
> </defines>
>
> <includePaths>
> <includePath>/usr/include/postgresql</includePath>
> <includePath>/usr/include/postgresql/9.2/server/</includePath>
> <includePath>src/main/include/</includePath>
> <includePath>target/nar/javah-include/</includePath>
> </includePaths>
> </c>
> </configuration>
> </plugin>
> </plugins>
>
> </build>
> </project>
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Christian Hammers 2013-02-07 16:06:45 [Pljava-dev] Building pljava.so with maven-nar-plugin?
Previous Message Christian Hammers 2013-02-06 01:31:02 [Pljava-dev] Building pljava.so with maven-nar-plugin?