<project>
...
<groupId>com.company.entity</groupId>
<artifactId>entity-api</artifactId>
<dependencies>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>entity-service</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>service</classifier>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com/company/entity/EntityAPIApplication</mainClass>
</manifest>
</archive>
<excludes>
<exclude>**/com/company/*/controller/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
but after running this in command line it is raising this error
>>>>>>>>>>>>
C:\Users\rkaparav\Desktop\check excluded or not from jar>java -jar entity-api-0.1.0-SNAPSHOT-service.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
at com.company.entity.EntityAPIApplication.main(EntityAPIApplication.java:17)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
please help me to make that jar a runnable spring boot application