Question

I would not want to filter some files in overlays, when building a war file. For example how I can exclude from filtering all jsp files from overlay module2?

            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1-beta-2-SNAPSHOT</version>
            <configuration>
                <archiveClasses>true</archiveClasses>
                <filters>
                    <filter>src/main/filters/config.properties</filter>
                </filters>

                <overlays>
                    <overlay>
                        <groupId>com.company</groupId>
                        <artifactId>module1</artifactId>
                        <filtered>true</filtered>
                    </overlay>
                    <overlay>
                        <groupId>com.company</groupId>
                        <artifactId>module2</artifactId>
                        <filtered>true</filtered>
                    </overlay>
                    <overlay>
                        <groupId>com.company</groupId>
                        <artifactId>module3</artifactId>
                        <filtered>true</filtered>
                    </overlay>
                </overlays>
            </configuration>
Was it helpful?

Solution

You could "cheat" and declare jsp as an extensions that will not be filtered.

    ...
    <configuration>
      <archiveClasses>true</archiveClasses>
      <filters>
        <filter>src/main/filters/config.properties</filter>
      </filters>
      <nonFilteredFileExtensions>
        <!-- default value contains jpg,jpeg,gif,bmp,png -->
        <nonFilteredFileExtension>jsp</nonFilteredFileExtension>
      </nonFilteredFileExtensions>
      ...
    </configuration>

But this is a global settings, i.e. it will affect all overlays, I don't know how you could exclude only of them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top