我有一个 springboot 项目,它将所有依赖的 jar 添加到 lib 文件夹中。 我怎样才能避免这种情况?
我试过了,但不起作用
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- <excludeScope>compile</excludeScope>
<excludeArtifactIds>*</excludeArtifactIds>
<excludeGroupIds>*.*</excludeGroupIds> -->
<exclude>
<groupId>*.*</groupId>
<artifactId>*</artifactId>
</exclude>
</configuration>
</plugin>
我不想将依赖项作为提供
还有其他解决方案吗?
最佳答案
您可以通过在 pom.xml 中指定不需要的依赖项来排除。 如下所示。
这里我不需要boot提供的嵌入式tomcat。因此我们可以使用以下标签排除它:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
关于java - 从 Spring Boot 中排除 Maven 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35769105/