views:

243

answers:

1

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>
+1  A: 

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.

Pascal Thivent
Thank you! It works now. I knew about this tag, but my mistake was that I incorrect specify two extensions <nonFilteredFileExtension>jsp,jar</nonFilteredFileExtension>instead <nonFilteredFileExtensions> <nonFilteredFileExtension>jsp</nonFilteredFileExtension> <nonFilteredFileExtension>jar</nonFilteredFileExtension> </nonFilteredFileExtensions>
eugenn
@eugenn Glad it was useful. And feel free to accept this answer then :)
Pascal Thivent