简体   繁体   中英

How do I exclude folders/files from my Maven War build?

I have a Java 8 backend application that uses an angular 6 front end. During the maven build it takes about 15 minutes to copy in the raw angular 6 source files and node modules. Seeing that I only need the compiled angular 6 /dist folder I would like to ignore/exclude the angular source.

I am using the maven-war-plugin (v. 3.2.2) to package my war. I have tried using both packagingExcludes and warSourceExcludes but in the end the total build still takes 20 minutes and includes my angular source files and all the node modules (an extra total 300 MBs).

My file structure is as such.

Java_WAR_App
    src
        main
            java
            resources
            webapp
                dist (compiled angular)
                angular_app (folder to exclude)
                WEB-INF

Here is my current maven-war-plugin

       <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.2.2</version>
            <configuration>
                <!-- DON'T include the raw angular folder or build takes forever -->
                <packagingExcludes>src/main/webapp/angular_app/**</packagingExcludes>
            </configuration>
        </plugin>

For the life of me I don't know why this is not working. Any help would be greatly appreciated.

在尝试了许多不同的方法来排除文件夹后,都失败了,我只是将原始 angular 代码移出 web 应用程序并将其放置在与 java 文件夹相同的级别。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM