Spring Run Configurations - programmatically starting a boot app included as depdency

Answered

I have a plugin that contains a dependency that is a boot app. I want my plugin to be able to programmatically run this boot app.  I first started down the path of creating a configuration and adding it to the run manager. I think this works because in my testing the new IDE that gets started up from run `runIDE` contains this module because I added it.  If the spring boot app is a gradle dependency to my plugin and I don't want to require users to have this ‘other’ project module included/open in their IDE when they are developing. Should I abandon creating a spring boot application run configuration , adding that configuration, and starting it programmatically via my plugin? I do own/author the dependent application I am trying to run from the plugin. I wonder if I should make an executable JAR via that dependents project build and include that in my plugin projects dependency. 

Questions: 

  1.  Given my context can I accomplish what I want via these run configurations
  2. Or should I use the configurations to run the executable JAR? 
0
1 comment

You can run your Spring Boot app from your plugin without needing users to have the project open. Instead of creating a run configuration, build an executable JAR of the Spring Boot app and include it as a dependency in your plugin. Use Java's ProcessBuilder to run the JAR programmatically. This approach keeps things simple and decouples the Spring Boot app from the IDE.

0

Please sign in to leave a comment.