Maven:如何排除某些资源

时间:2018-06-29 16:17:34

标签: maven pom.xml

如何使用org.apache.maven.plugins:maven-war-plugin排除CSS文件?

如果最小化,我需要排除CSS。如果存在xxx.min.css,则排除xxx.css。 我仅针对具有名称模式的文件创建了解决方案,这并不是在所有情况下都通用:

       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <packagingExcludes>%regex[.*[-+](\d+)(?!=\.min)\.css]</packagingExcludes>
            </configuration>
            <executions>
                <execution>
                    <id>parent-resources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>exploded</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

0 个答案:

没有答案
相关问题