I need to run one java spring boot application (REST API) with external jars twice at the same time. So I created two "working directories" for the external jars and tried to let the application to run there. To do this I changed the run configuration like this: RunConfig for Server 1 I also put the application.properties file inside this path and set a port there (not 8080). If I click run in eclipse it starts with the port defined in file from the given path. I do this for server 2 with a different path and port and I have two independent spring boot servers (tomcat) running at the same time!
Now I need to have this at runtime and at this point I'm stuck.
If I click on "Show Command Line" in the RunConfig, copy it and run it from the command line (windows) it starts with the standard port at the workspace location. However if I use Duser.dir=C:\NotTheWorkspacePath\Server1 or if I use a ProcessBuilder and put the path to the "Directory" it says, that it can't find the class inside this directory, which is understandable since it's not the workspace.
So my real question is, what is eclipse doing if I click the small green "Run"-Button and how can I reproduce it in this scenario?
I need to be carful with posting source code snippets, cause it's internal to my business partner and I hope You can find the solution without it. (e.g. the classpath of spring is huge, I'm not sure to find all internal information before posting it)
Thank You for Your help!
Best Regards, Tim
(I also tried to let it run as a runable jar, but I think I can't export a spring application as a standard runable jar, because by doubleclicking I get an error from the jarinjarloader ... but I also can't repackage it via maven because I get an compiler error trying mvn clean package spring-boot:repackage)