Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude node_modules directory

Tags:

spring

maven

Below is the directory structure of my Spring MVC project. Since the size of the node_modules, I want to exclude the directory during the maven build.

I have tried several methods, but none of them worked for me.

Below is the build part of 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

Also I tried warSourceExcludes, but also it didn't work.

Please share any of your idea.

Thanks.

like image 421
Sooyong Kim Avatar asked Dec 28 '15 16:12

Sooyong Kim


1 Answers

Try this :

<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>
like image 185
Rafik BELDI Avatar answered Oct 11 '22 10:10

Rafik BELDI