Start Spring Application without a main method


This Content is from Stack Overflow. Question asked by Tyler

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

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 = "", description = "Its a plugin", authors = {"Me"})
class VelocityPlugin {

    val server: ProxyServer;
    val logger: Logger;

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

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

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
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.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?