Declare S9 example functions only if s9api on deploy-time class path#520
Merged
jcflack merged 1 commit intoREL1_6_STABLEfrom Mar 15, 2025
Merged
Declare S9 example functions only if s9api on deploy-time class path#520jcflack merged 1 commit intoREL1_6_STABLEfrom
S9 example functions only if s9api on deploy-time class path#520jcflack merged 1 commit intoREL1_6_STABLEfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Maven build has long offered an optional
-Psaxon-examplesprofile; without it, the examples jar gets built without theS9example, and can be deployed in a database without the Saxon jar loaded. With the profile active, the jar is built with theS9example included, and then that jar can't be loaded (withdeploy => true) unless the database already has a Saxon jar installed and on the class path, even if there is no need for theS9examples. 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
S9examples 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 thesaxon-examplesprofile 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
S9example functions), but laterremove_jaris called (withundeploy => 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 theS9functions 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.