Start Spring Application without a main method

Viewed 34

Im trying to run a Spring App in Kotlin that was built using gradle, without the use of the main method. I have generated the project using start.spring.io

I do not have access to run spring via the main method of a jar, because it is a plugin esk system. In this system, I place the generated jar file from gradle into a "plugins folder" (only contains jar files) and start the application from the main jar file outside of the plugins folder. This main jar then loads all the other jar files from the plugins folder.

I am trying to build a Spring app for various reasons on top of this third party platform for building Minecraft Server Proxies called Velocity MC

This is the main class of the Velocity Plugin where I am attempting to start the Spring App, and here is the error I am getting.

@Plugin(id = "my-plugin", name = "My Plugin", version = "v1",
        url = "https://example.org", description = "Its a plugin", authors = {"Me"})
class VelocityPlugin {

    val server: ProxyServer
    val logger: Logger

    @Inject
    constructor(server: ProxyServer, logger: Logger) {
        this.server = server
        this.logger = logger

        runApplication<SpringApp>() // Trying to start Spring from here
    }
}

@SpringBootApplication
class SpringApp

[22:16:12 ERROR] [org.springframework.boot.SpringApplication]: Application run failed java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories nor in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. If you are using a custom packaging, make sure that file is correct.

This is a general issue for Spring and after a couple of hours of research, I have found next to nothing on. Any help is appreciated. Thank you.

EDIT: I thought it is also worth mentioning that I have found other ways to run a Spring App via command line or a war file. But neither are suitable for the needs of this project.

0 Answers
Related