-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KNOX-3051: Ability to extend classpath with configurable paths #971
Merged
Conversation
This file contains 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
smolnar82
requested changes
Dec 2, 2024
gateway-util-launcher/src/test/java/org/apache/knox/gateway/launcher/ExtenderTest.java
Outdated
Show resolved
Hide resolved
gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/Extender.java
Outdated
Show resolved
Hide resolved
gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/Extender.java
Outdated
Show resolved
Hide resolved
gateway-util-launcher/src/test/java/org/apache/knox/gateway/launcher/ExtenderTest.java
Outdated
Show resolved
Hide resolved
smolnar82
approved these changes
Dec 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @moresandeep , @pzampino - Could you please review this one? Thanks! |
pzampino
reviewed
Dec 3, 2024
gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/Extender.java
Outdated
Show resolved
Hide resolved
gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/Extender.java
Outdated
Show resolved
Hide resolved
…erence to the properties
pzampino
approved these changes
Dec 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
What changes were proposed in this pull request?
Classpath extension for patches
It would be convenient to have the ability to easily pre-pend classes/JARs to the Knox classpath for quickly applying/testing patches. This approach is completely configurable and multiple locations can be configured although their order has to be kept in mind to avoid overrides. Placing any class or JAR in these locations will take precedence on the classpath as it will come first. These locations can be within the Knox installation, external to it or even a mix of them.
The logic is checking the gateway-site.xml file for 'gateway.server.classpath.extension' property, if it is there it will extend the classpath with its value. The launcher only modifies the classpath for the GatewayServer. There is a check for the main class that's in the properties and if it is 'org.apache.knox.gateway.GatewayServer' only then the classpath is extended.
Example extension:
How was this patch tested?