spring - 如何排除 node_modules 目录

标签 spring maven

下面是我的 Spring MVC 项目的目录结构。
由于node_modules的大小,我想在maven构建期间排除该目录。

我尝试了几种方法,但没有一种对我有用。

下面是 pom.xml 的构建部分

<build>
<finalName>ROOT</finalName>
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
      <excludes>
        <exclude>node_modules</exclude>
      </excludes>
    </configuration>
    <version>3.1</version>
  </plugin>
</plugins>

enter image description here

我也试过warSourceExcludes,但也没有用。

请分享您的任何想法。

谢谢。

最佳答案

尝试这个 :

<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
      <excludes>
        <exclude>**/src/main/java/webapp/node_modules/*</exclude>
      </excludes>
    </configuration>
    <version>3.1</version>
  </plugin>
</plugins>

关于spring - 如何排除 node_modules 目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34496852/

相关文章:

java - 在 Spring 4.0.6 中无法将值从 Controller 发送到文件 jsp

java - @Autowired 和静态方法

spring - 使用 Spring Security oauth2 进行两因素身份验证

java - "mvn test"在控制台中给出不同的错误

maven - 无法传输 Artifact - 未授权

java - 线程 main 中的异常 - maven 依赖

eclipse - Java EE 6 的 Maven 与 Eclipse 项目 Facets

java - Liferay Maven 服务构建器失败

java - 配置 Springboot Cloud Config Server - management.security.enabled=false 标志不起作用

spring - 使用 Spring Data : column $COLUMN_NAME is of type timestamp without time zone but expression is of type bytea 的 postgres 中的时间戳错误