-
Notifications
You must be signed in to change notification settings - Fork 80
/
pom.xml
327 lines (313 loc) · 9.35 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<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>1.5.0-BETA1</version>
</parent>
<artifactId>pljava-so</artifactId>
<name>PL/Java backend native code</name>
<description>
Generates the pljava (.so, .dll, etc.) library which gets loaded by the PostgreSQL backend
</description>
<packaging>nar</packaging>
<properties>
<!-- use -Dnar.cores=1 if non-interleaved warning messages wanted -->
<nar.cores>0</nar.cores>
</properties>
<profiles>
<profile>
<id>osx</id>
<activation>
<os>
<name>mac os x</name>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<linker>
<options>
<option>-bundle_loader</option>
<option>${PGSQL_BINDIR}/postgres</option>
</options>
</linker>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>compiler-msvc</id>
<activation>
<property>
<name>env.VCINSTALLDIR</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<c>
<defines combine.children='append'>
<!-- Need this for Visual Studio 2013 and Postgresql v9.3 and below -->
<define>${MSVC_RINT}</define>
</defines>
<includePaths combine.children='append'>
<includePath>${PGSQL_INCLUDEDIR-SERVER}/port/win32</includePath>
<includePath>${PGSQL_INCLUDEDIR-SERVER}/port/win32_msvc</includePath>
<includePath>${basedir}/src/main/include/fallback/win32</includePath>
</includePaths>
</c>
<linker>
<libs combine.children='append'>
<lib>
<name>postgres</name>
<type>shared</type>
<directory>${PGSQL_PKGLIBDIR}</directory>
</lib>
</libs>
</linker>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>wnosign</id>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<configuration>
<c>
<options>
<option>-Wno-sign-conversion</option>
</options>
</c>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<!-- Several things that could not be done using Maven plugins. This plugin
must be listet FIRST as the pgsql.properties file has to be written before
properties-maven-plugin is called, which can apparently also only happen
in the "initialize" phase. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<!-- Converts pg_config output to "pgsql.properties" -->
<execution>
<id>pg_config to pgsql.properties</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<ant />
</target>
</configuration>
</execution>
<!-- Deploy the PostgreSQL library by copying it.
<execution>
<id>deploy pljava.so</id>
<phase>deploy</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy verbose="true"
file="${basedir}/target/nar/pljava-so-${project.version}-${nar.aol}-shared/lib/${nar.aol}/shared/libpljava-so-${project.version}.so"
tofile="${PGSQL_PKGLIBDIR}/pljava.so" />
</target>
</configuration>
</execution> -->
</executions>
</plugin>
<!-- Reads the pg_config properties, which were extracted by an Ant task
in the "initialize" phase, into Maven variables. As this plugin seems to
get ignored in any phase other than "initialize" it must be listed after
the Ant task. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/target/pgsql.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<!-- Compiles and links the C library. -->
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<maxCores>${nar.cores}</maxCores>
<!-- Generates C header files from Java class files. -->
<javah>
<classPaths>
<classPath>${basedir}/../pljava/target/classes/</classPath>
<classPath>${basedir}/../pljava-api/target/classes/</classPath>
</classPaths>
<classDirectory>${basedir}/../pljava/target/classes/</classDirectory>
<extraClasses>
<extraClass>java.sql.Types</extraClass>
</extraClasses>
</javah>
<!-- Compiles the C sources to object files. -->
<c>
<!-- uncomment the next line if you need to configure your compiler (e.g. clang)
<name>${CPP_COMPILER}</name>
-->
<defines>
<define>PLJAVA_SO_VERSION=${project.version}</define>
</defines>
<includePaths>
<!-- TODO: hardcoded paths -->
<includePath>${PGSQL_INCLUDEDIR}</includePath>
<includePath>${PGSQL_INCLUDEDIR-SERVER}</includePath>
<includePath>${basedir}/src/main/include/</includePath>
<includePath>${basedir}/target/nar/javah-include/</includePath>
</includePaths>
</c>
<!-- Defines linker flags "-ljvm -L.../server" -->
<linker>
<libs>
<lib>
<name>ecpg</name>
<type>shared</type>
<directory>${PGSQL_LIBDIR}</directory>
</lib>
<lib>
<name>pgtypes</name>
<type>shared</type>
<directory>${PGSQL_LIBDIR}</directory>
</lib>
<lib>
<name>pq</name>
<type>shared</type>
<directory>${PGSQL_LIBDIR}</directory>
</lib>
</libs>
</linker>
<!-- Builds a *.so library. -->
<libraries>
<library>
<type>plugin</type>
<!-- Do not add "-lstdc++". Adds "-shared-libgcc" though. -->
<linkCPP>false</linkCPP>
</library>
</libraries>
</configuration>
</plugin>
<!-- The deploy goal will be hijacked by an ant task so the original plugin
has to be silenced until we actually use it.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin> -->
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<versionRange>[1.0-alpha-2,)</versionRange>
<goals>
<goal>
read-project-properties
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<versionRange>[3.2.3]</versionRange>
<goals>
<goal>nar-compile</goal>
<goal>nar-download</goal>
<goal>nar-gnu-configure</goal>
<goal>nar-gnu-make</goal>
<goal>nar-gnu-process</goal>
<goal>nar-gnu-resources</goal>
<goal>nar-javah</goal>
<goal>nar-system-generate</goal>
<goal>nar-resources</goal>
<goal>nar-testCompile</goal>
<goal>nar-testDownload</goal>
<goal>nar-testUnpack</goal>
<goal>nar-unpack</goal>
<goal>nar-validate</goal>
<goal>nar-vcproj</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>