Skip to content

Ability to add additional external classpath directory #78

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

Closed
dantran opened this issue Nov 23, 2018 · 16 comments
Closed

Ability to add additional external classpath directory #78

dantran opened this issue Nov 23, 2018 · 16 comments
Milestone

Comments

@dantran
Copy link

dantran commented Nov 23, 2018

spring-boot-thin-launch works great for my none spring app as well but I lose the ability the setup external classpath.

Possible to add -Dthin.extraClassPath=xxxx ?

This option allows me to configure my logback.xml location

@dsyer
Copy link
Collaborator

dsyer commented Nov 23, 2018

Can you explain a bit more with a sample app and a README? Why would you want to use the classpath to set an XML file location (you could just use a file URL)?

@dantran
Copy link
Author

dantran commented Nov 23, 2018

application with logback automatically searches for logback.xml configuration in its classpath. and I need to use external file. this way I can control the location of the log output

dont think there is a way to configure the location of logback.xml for none-spring boot app

Will update my demo project to show you

@dsyer dsyer changed the title Ability to add addtional external classpath directory Ability to add additional external classpath directory Nov 23, 2018
@dsyer
Copy link
Collaborator

dsyer commented Nov 23, 2018

dont think there is a way to configure the location of logback.xml for none-spring boot app

Link to docs: https://logback.qos.ch/manual/configuration.html#configFileProperty

@dantran
Copy link
Author

dantran commented Nov 23, 2018

-Dlogback.configurationFile works (big thanks, not sure why i missed that :( )

however, i believe there may be other scenarios that I may need this feature. I believe fat spring-boot users also running into this scenario where user have to set layout=ZIP which overrides thin boot layout

@dsyer
Copy link
Collaborator

dsyer commented Nov 23, 2018

Maybe. Not sure I understand those scenarios yet. Nothing to do yet, I guess.

@jchharris
Copy link

Our use case for this functionality is that our application supports the concept of plugins which are represented by JAR files. The plugins that a particular instance of the application needs to use can't be determined at build time and is only determined at runtime by loading the plugin jars from known locations on the classpath.

@dsyer
Copy link
Collaborator

dsyer commented Apr 16, 2019

@jcharris that’s a perfect use case for the existing thin.properties features. You just need to make all the “plugin” jars available in a Maven repository (local or remote).

@jchharris
Copy link

If I can include just a directory path in thin.properties that would work fine. Having to edit the thin.properties file to include each plugin JAR and plugin JAR dependencies is not an application run time solution. With traditional WARs we have the build time dependencies in the WAR but can add additional functionality via JARs on the external classpath. This doesn't require any knowledge of exactly what is present in that directory until the application starts and looks for stuff that implements its Plugin interfaces..

@dsyer
Copy link
Collaborator

dsyer commented Apr 17, 2019

Why would the runtime jars need to be in a specific directory though? You can just put them in a Maven repo layout and it will already work just fine.

@rainmanhhh
Copy link

Why would the runtime jars need to be in a specific directory though? You can just put them in a Maven repo layout and it will already work just fine.

some local deps are not in maven repo. (eg. build.gradle: implementation files("./lib/arcsoft-sdk-face-2.1.0.0.jar"))

@githubyong
Copy link

Why would the runtime jars need to be in a specific directory though? You can just put them in a Maven repo layout and it will already work just fine.

application was released,but integration jars are unknown before release.,so we want add those jars in a specific directory,and load it at jvm start.

@dsyer
Copy link
Collaborator

dsyer commented Nov 1, 2019

So can't you put them in ~/.m2/repository? You can use mvn install -D... I think, if you don't want to guess the layout.

@githubyong
Copy link

So can't you put them in ~/.m2/repository? You can use mvn install -D... I think, if you don't want to guess the layout.

if thin-launcher support it , we only need to put jars into the directory.
but if in your way,we have to :
1.install maven on server.
2.mvn install jars one by one
3.edit thin.properties

this is not convenient, and perhaps application manager doesn't have knowledge of "maven" and "thin-layout".

@dsyer
Copy link
Collaborator

dsyer commented Nov 24, 2020

this is not convenient

I get that, but if we add an "additional classpath" option it makes the executions non-reproducible - you have to ensure that the classpath is valid before you run, and that means copying files around, which is unreliable and also not convenient. Who is the "application manager" in your scenario? What does he or she have to do to locate the additional libraries?

@abelsromero
Copy link

We may have an another possible use case. Users may be able to mount jar files in a k8s environment to enable/disable certain features with autoconfiguration.

@dsyer
Copy link
Collaborator

dsyer commented Mar 17, 2023

Added thin.libs configuration in 168cc03

@dsyer dsyer closed this as completed Mar 17, 2023
@dsyer dsyer added this to the 1.0.30 milestone Mar 17, 2023
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

No branches or pull requests

6 participants