I have a resource file call names.txt that is called by my code when I hit a rest endpoint.
This is held in src//main//resources//names.txt. I have an application.yml that references the file location as such
file:
namesPath: src//main//resources//names.txt
when I build and run my solution everything works fine. If i run the jar from the commandline outside the IDE it also works fine.
How ever if I copy that JAR to another instance, it complains and says that it cannot find the file referenced
If I browse the JAR the file is there but it is under BOOT-INF/Classes/names.txt
How do I solve this so I can deploy the JAR wherever I want?
It is hard to say what is wrong without seeing your build.gradle file but I would expect if you put something like below in your build file the resource files should end up in the right location:
sourceSets {
main {
java {
srcDirs = ['src/main/java', 'src/gen/java']
}
resources {
srcDirs = [src/main/resources']
}
}
....
}
Controller Advice bean not instantiated at proper order in Spring Boot 2.4
What should I enter to the connection string to connect my NodeJS application to a MongoDB server?
Unable to use Computed Property Values with Dots - Unable to Set as String - JS
I'm reading about garbage collection schemes and how they're optimized, but it's hard for me to grasp the tradeoffs because I don't have a feel for how often garbage collection is going to happenI tried Googling but couldn't find much of anything
I have a dialog in Java that presents ~ 15 checkboxes to the userIs there a way to get the names of all the checked checkboxes at once? Currently, I'm looking one by one if they are selected, which isn't that fancy of a solution
I am creating a program in which a server can receive messages from multiple clientsThe clients would create the connection and upon clicking a button, sending information and then close the connection (not a back and forth live chat program)