springboot project, carry all depend on when packaging
This article is mainly to solve springboot package it, how can we set up all the dependencies of the current project are to break into.
Springboot comes with spring-boot-maven-plugin
plug-in package that does not carry it all depends, but sometimes there will be demand dependent on the need to fight together in, for example, you need to be labeled as an executable jar package.
If you need to add package dependencies can use the following plug-in that last fight out of the jar package there are two, are without jar-with-dependencies
suffix, and with a jar-with-dependencies
suffix behind this is what we need.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptorRefs>jar-with-dependencies</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>