My project is running fine in eclipse. I was using the following plugin to build my jar with dependencies.
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>com.project.App</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
On running the jar, I got the following error.
2017-07-17 15:21:06.825 ERROR 17587 --- [
main] o.s.boot.SpringApplication :
Application startup failed
org.springframework.beans.factory.BeanDefinitionStoreException:
Failed to process import candidates for configuration class [com.project.App];
nested exception is java.lang.IllegalArgumentException:
No auto configuration classes found in META-INF/spring.factories.
If you are using a custom packaging, make sure that file is correct.
I found this solution to use spring-boot-maven-plugin and modified my code as shown below.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>com.project.App</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The error was fixed. However, the jar created through this process does not contain dependencies. Is it possible to build jar with dependencies using spring-boot-maven-plugin? Kindly suggest a solution.