spring boot项目打包资源分离

转载于:https://www.cnblogs.com/purely/p/13085026.html 
<!--打包时排除掉资源文件-->
<resources>
    <resource>
        <directory>src/main/resources</directory>
        <excludes>
            <exclude>**/**</exclude>
        </excludes>
    </resource>
</resources>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
            </configuration>
        </plugin>

        <!--打包时去除第三方依赖-->
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
            <layout>ZIP</layout>
            <includes>
                <include>
                    <groupId>non-exists</groupId>
                    <artifactId>non-exists</artifactId>
                </include>
            </includes>
        </configuration>
    </plugin>
        <!--拷贝第三方依赖文件到指定目录-->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
            <execution>
                <id>copy-dependencies</id>
                <phase>package</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <!–target/lib是依赖jar包的输出目录,根据自己喜好配置–>
                    <outputDirectory>target/lib</outputDirectory>
                    <excludeTransitive>false</excludeTransitive>
                    <stripVersion>false</stripVersion>
                    <includeScope>runtime</includeScope>
                </configuration>
            </execution>
        </executions>
    </plugin>
    </plugins>
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页