Personal development, there is no need to build a nexus, so for us to use Spring boot development project, we will introduce the local jar package, for example, I will build a Lib package in the root directory, and then put the local jar inside, add to the Classpath reference.
Then you will find that when we hit the jar, we were unable to package the jar under the Lib into the boot fat jar. Causes the program to fail to start. So you just follow the configuration below, configure the POM packaging plug-in is OK. (I haven't seen a few of them for a while, just need to change the pom.xml build.)
<project.basedir>d:/xxx/workspace/Project Name </project.basedir>
<Build> <Plugins> <plugin> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-maven-plugin</Artifactid> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration& Gt <source>1.8</source> <target>1.8</target> <encoding>ut F-8</encoding> <compilerArguments> <extdirs>${project.basedir} /lib</extdirs> </compilerArguments> </configuration> </p lugin> </plugins> <resources> <resource> <directory>${p Roject.basedir}/lib</directory> <targetPath>BOOT-INF/lib/</targetPath> < ;includes> <include>**/*.jar</include> </includes> </ Resource> <resource> <directory>src/main/resources</directory> <targetPath>BOOT-INF/classes/</targetPath> </resource> </resources> </Build>
The red font is configured in the back. Note that you have to write Boot-inf this is the directory structure inside the boot packaged jar. This will pack your local jar together. Hey! I wrote it down, and it's refreshing in the afternoon!
sping boot How to hit the outer jar package into the fat jar