Maven Runnable Jar

This sections shows how to create a full runnable jar using both, SptingBoot plugin and Maven Shade Plugin

SpringBoot Plugin

Add the following plugin tag in the build→plugins tag of your pom.xml file.

		<plugin>
		<!-- Build an executable JAR -->
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-maven-plugin</artifactId>
		<executions>
			<execution>
			<goals>
				<goal>repackage</goal>
			</goals>
			<configuration>
				<classifier>full</classifier>
				<mainClass>com.app.Main</mainClass>
			</configuration>
			</execution>
		</executions>
		</plugin>

Maven Shade Plugin

Add the following plugin tag in the build→plugins tag of your pom.xml file.

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.3</version>
				<configuration>
				<createDependencyReducedPom>true</createDependencyReducedPom>
				<filters>
				<filter>
					<artifact>*:*</artifact>
					<excludes>
					<exclude>META-INF/*.SF</exclude>
					<exclude>META-INF/*.DSA</exclude>
					<exclude>META-INF/*.RSA</exclude>
					</excludes>
				</filter>
				</filters>
				</configuration>
				<executions>
					<execution>
					<phase>package</phase>
					<goals>
						<goal>shade</goal>
					</goals>
					<configuration>
						<transformers>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>com.app.Main</mainClass>
						</transformer>
						</transformers>
					</configuration>
					</execution>
				</executions>
			</plugin>