1、pom.xml修改如下:

<plugins>
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
            <mainClass>com.App</mainClass>
            <layout>ZIP</layout>
            <includes>
                <include>
                    <groupId>nothing</groupId>
                    <artifactId>nothing</artifactId>
                </include>
            </includes>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>repackage</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
<plugins>


2、然后获得分离出来的lib
mvn dependency:copy-dependencies -DoutputDirectory=F:\lib -DincludeScope=runtime

3、运行java
java -Dloader.path=/path/to/lib -jar /path/to/springboot-0.0.1-SNAPSHOT.jar

标签: none

添加新评论