Filter filenames in Maven
I'd like to be able to filter filenames as well as file contents in Maven.

The below snippet enables filtering on file contents, but I need to be able to rename files too. 

The usage scenario is that I'd like all static resources in my webapp to be numbered, so they can be treated as different versions by Amazon's CloudFront. Naturally managing the numbers manually would be impractical, so I'd like the build process to do this.

For instance a file called

    logo_VERSION.jpg

would end up being called

    logo_254.jpg

Any ideas if this is possible without writing a custom plugin?


----------


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                	<webResources>
                		<resource>
                			<directory>/src/main/webapp</directory>
                			<filtering>true</filtering>
                		</resource>
                	</webResources>
                	...
Filter filenames in Maven
===

I'd like to be able to filter filenames as well as file contents in Maven.

The below snippet enables filtering on file contents, but I need to be able to rename files too. 

The usage scenario is that I'd like all static resources in my webapp to be numbered, so they can be treated as different versions by Amazon's CloudFront. Naturally managing the numbers manually would be impractical, so I'd like the build process to do this.

For instance a file called

    logo_VERSION.jpg

would end up being called

    logo_254.jpg

Any ideas if this is possible without writing a custom plugin?


----------


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                	<webResources>
                		<resource>
                			<directory>/src/main/webapp</directory>
                			<filtering>true</filtering>
                		</resource>
                	</webResources>
                	...