@@ -25,13 +25,6 @@ When building a package, you are
25
25
encouraged to set the default ` pljava.libjvm_location ` to the library of a
26
26
JRE version that is expected to be present on your platform.
27
27
28
- ** Note:** when building on Windows, the ` -Dpljava.libjvmdefault ` option is
29
- likely to produce a failed build or the wrong stored value for the library
30
- path. A fix for this option on Windows is unlikely (see [ issue 190] [ bug190 ] );
31
- if preparing a package for Windows, it will be simplest to use a patch that
32
- changes the definition of ` PLJAVA_LIBJVMDEFAULT ` in
33
- ` pljava-so/src/main/c/Backend.c ` .
34
-
35
28
[ locatejvm ] : ../install/locatejvm.html
36
29
[ bug190 ] : https://github.com/tada/pljava/issues/190
37
30
@@ -78,11 +71,13 @@ shown in that link to disable the repacking of jars.
78
71
The one part of PL/Java that could, if desired, be handled in the manner of
79
72
Java libraries is ` pljava-api ` . This single jar file is needed on the classpath
80
73
when compiling Java code that will be loaded into PL/Java in the database.
81
- It is _ not_ needed at the time that code will _ run_ . That means it could be
82
- appropriate to treat ` pljava-api ` as a separate ` -devel ` package, if your
83
- packaging guidelines encourage such a distinction. In that case, you would
84
- exclude the ` pljava-api ` jar file from the main package, and produce a ` -devel `
85
- package that provides it.
74
+ That means it could be
75
+ appropriate to provide ` pljava-api ` in a separate ` -devel ` package, if your
76
+ packaging guidelines encourage such a distinction, where it would be installed
77
+ in the expected place for a conventional Java library. (The API jar must still
78
+ be included in the main package also, installed in the location where PostgreSQL
79
+ expects it. There may be no need, therefore, for the main package to depend on
80
+ the ` -devel ` package.)
86
81
87
82
A ` -devel ` package providing ` pljava-api ` might appropriately follow
88
83
java library packaging guidelines to ensure it appears on a developer's
@@ -108,7 +103,7 @@ is the useful one to have in an installation target host's repository.)
108
103
109
104
The PL/Java build does not automatically build javadocs. Those that go with
110
105
` pljava-api ` can be easily generated by running
111
- ` mvn --projects pljava-api javadoc:javadoc ` to build them, then collecting
106
+ ` mvn --projects pljava-api site ` to build them, then collecting
112
107
the ` apidocs ` subtree from ` target/site ` . They can be included in the same
113
108
package as ` pljava-api ` or in a separate javadoc package, as your guidelines
114
109
may require.
@@ -126,7 +121,7 @@ been built first and installed into the build host's local Maven repository.
126
121
Note that many of the examples do double duty as tests, as described in
127
122
_ confirming the build_ below.
128
123
129
- When building for (and with) Java 8 or later and PostgreSQL 8.4 or later ,
124
+ Unless they are not wanted ,
130
125
the XML examples based on the Saxon library should also be built,
131
126
by adding ` -Psaxon-examples ` to the ` mvn ` command line.
132
127
@@ -137,7 +132,7 @@ the package.
137
132
138
133
` -Dpljava.libjvmdefault= ` _ path/to/jvm-shared-object_
139
134
: As suggested earlier, please use this option to build a useful default
140
- into PL/Java for the ` pljava.libjvm_location ` PostgreSQL variable, users
135
+ into PL/Java for the ` pljava.libjvm_location ` PostgreSQL variable, so users
141
136
of your package will not need to set that variable before
142
137
` CREATE EXTENSION pljava ` works.
143
138
@@ -170,6 +165,14 @@ Some tests involving Unicode are skipped if the `server_encoding` is not
170
165
` utf-8 ` , so it is best to run them in a server instance created with that
171
166
encoding.
172
167
168
+ To simplify automated testing, the jar file that is the end product of a full
169
+ PL/Java source build contains a class that can serve as a PostgreSQL test
170
+ harness from Java's ` jshell ` script engine. It is documented [ here] [ node ] ,
171
+ and the continuous-integration scripts in PL/Java's own source-control
172
+ repository can be consulted as examples of its use.
173
+
174
+ [ node ] : ../develop/node.html
175
+
173
176
## Packaging the built items
174
177
175
178
The end product of a full PL/Java source build is a jar file that functions as
@@ -179,8 +182,11 @@ those needed to support `ALTER EXTENSION UPGRADE`.
179
182
180
183
It also contains the ` pljava-api ` jar, needed for developing Java code to use
181
184
in a database with PL/Java, and the ` pljava-examples ` jar. As discussed above,
182
- these may be omitted from a base package and supplied separately, if packaging
183
- guidelines require.
185
+ the examples jar may be omitted from a base package and supplied separately,
186
+ if packaging guidelines require, and the API jar may be included also in a
187
+ ` -devel ` package that installs it in a standard Java-library location. (However,
188
+ the API jar cannot be omitted from the base package; it is needed at runtime, in
189
+ the ` SHAREDIR/pljava ` location where the extension expects it.)
184
190
185
191
The self-extracting jar consults ` pg_config ` at the time of extraction to
186
192
determine where the files should be installed.
@@ -216,9 +222,10 @@ will have on the target system.
216
222
217
223
In addition to the files named in the self-extractor's output, additional
218
224
files could be included in the package (if guidelines require the README
219
- or COPYRIGHT, for example). As discussed above, the ` pljava-api ` jar could
220
- be filtered from the list if it will be delivered in a separate ` -devel `
221
- package, and the same could be done for ` pljava-examples ` .
225
+ or COPYRIGHT, for example). As discussed above, the ` pljava-examples ` jar could
226
+ be filtered from the list if it will be delivered in a separate
227
+ package, and the ` pljava-api ` jar could be additionally delivered in a separate
228
+ ` -devel ` package (but must not be excluded from the base package).
222
229
223
230
[ install ] : ../install/install.html
224
231
0 commit comments