Maven - maven-war-plugin shift destination folder (except for web application)

I use springboot, but I do not want it to copy the webapp folder during the maven-war-plugin task, because it contains many files, such as the bower_components folder. I use grunt, so I am adding another folder to my war.

[INFO] --- maven-war-plugin:2.6:war (default-war) @ saturne --- [INFO] Packaging webapp [INFO] Assembling webapp [saturne] in [D:\Workspaces\MyProject\trunk\target\saturne-1.0.0] [INFO] Processing war project ... [INFO] Copying webapp resources [D:\Workspaces\MyProject\trunk\src\main\webapp] 

I have tried many things, such as an exception in <resources> or how

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <webResources> <resource> <directory>src/main/webapp</directory> <exclude>**/*</exclude> </resource> </webResources> </configuration> </plugin> 

I cannot find a way to exclude it from the copy of the resource.

+7
source share
1 answer

This is not a SpringBoot error, maven-war-plugins always copies the webapp folder, so we changed its source to our required source.

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <warSourceDirectory>${basedir}/src/main/webapp-dist</warSourceDirectory> </configuration> </plugin> 
0
source

Source: https://habr.com/ru/post/1240076/


All Articles