Skip to content

Conversation

@jcflack
Copy link
Contributor

@jcflack jcflack commented Mar 14, 2025

The Maven build has long offered an optional -Psaxon-examples profile; without it, the examples jar gets built without the S9 example, and can be deployed in a database without the Saxon jar loaded. With the profile active, the jar is built with the S9 example included, and then that jar can't be loaded (with deploy => true) unless the database already has a Saxon jar installed and on the class path, even if there is no need for the S9 examples. That's an inconvenient restriction on later use of the examples jar based on a choice made at build time.

Use conditional execution in the deployment descriptor so that even when the examples jar is built with the S9 examples included, they are only deployed if a Saxon API class is found on the class path at deploy time. That way, the examples can be built with the saxon-examples profile active and still freely used without loading a Saxon jar if those examples are not of interest.

Some inconvenient situations, though less likely ones, can still arise. If the examples jar is installed when no Saxon jar is on the class path (and so does not declare the S9 example functions), but later remove_jar is called (with undeploy => true) when for some reason there is a Saxon jar on the class path, then the undeploy actions will detect the Saxon classes and try to drop the S9 functions that had not been declared. But this is a rare "so don't do that" case that is easily avoided, nothing like the serious inconvenience of never being able to use the examples jar without installing Saxon first, depending on how the jar was built.

The Maven build has long offered an optional -Psaxon-examples profile;
without it, the examples jar gets built without the S9 example, and
can be deployed in a database without the Saxon jar loaded. With the
profile active, the jar is built with the S9 example included, and then
that jar can't be loaded (with deploy => true) unless the database
already has a Saxon jar installed and on the class path, even if there
is no need for the S9 examples. That's an inconvenient restriction
on later use of the examples jar based on a choice made at build time.

Use conditional execution in the deployment descriptor so that even when
the examples jar is built with the S9 examples included, they are only
deployed if a Saxon API class is found on the class path at deploy time.
That way, the examples can be built with the saxon-examples profile active
and still freely used without loading a Saxon jar if those examples are
not of interest.

Some inconvenient situations, though less likely ones, can still arise.
If the examples jar is installed when no Saxon jar is on the class path
(and so does not declare the S9 example functions), but later
remove_jar is called (with undeploy => true) when for some reason there
is a Saxon jar on the class path, then the undeploy actions will detect
the Saxon classes and try to drop the S9 functions that had not been
declared. But this is a rare "so don't do that" case that is easily
avoided, nothing like the serious inconvenience of never being able
to use the examples jar without installing Saxon first, depending on
how the jar was built.
@jcflack jcflack merged commit 237b205 into REL1_6_STABLE Mar 15, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants