'maven - replace a string before copying file to another directory

I'm copying sql files to another directory using

<copy todir="../directory" filtering="true">
        <fileset dir="${project.basedir}/sql/creation/scripts" includes="*.sql"/>
        // i want to modify the file content of init.sql before copying
    </copy>

with init.sql

create sequence SCHEMA_NAME.SEQ_APP

i want to replace SCHEMA_NAME by $1. before copying it.

How can i do that ?

Thank you



Solution 1:[1]

The general way accomplish this is via Maven Resource Filtering - where the "filtering" is about replacing placeholders with actual values: https://maven.apache.org/shared/maven-filtering/

But you'll need to change the value in your SQL-file...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tveon