spring-boot-maven-plugin 打包排除指定文件
时间: 2024-05-28 15:07:03 浏览: 24
spring-boot-maven-plugin 是一个 Maven 插件,可以将 Spring Boot 应用程序打包成可执行的 jar 包或 war 包。如果你需要排除某些文件或目录,可以在 Maven 的 pom.xml 文件中配置该插件,添加以下的 build 节点:
```
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>com.example</groupId>
<artifactId>example</artifactId>
</exclude>
<exclude>
<groupId>com.example</groupId>
<artifactId>example2</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
```
在上面的例子中,我们排除了两个 artifactId 为 example 和 example2 的依赖。