0

I have a project where we are trying to execute a number (circa 100) of Oracle PL/SQL files. Each file contains a stored procedure. The procedures must be applied to the database in a set order. The stored procedures are supplied to us by a DBA team along with a procs.sql file with the ordered list of procs.

Looking at the sql maven plugin documentation it supports ant style filesets. The ant documentation provides documentation of a attribute of the fileset called according to the ant documentation: "the name of a file; each line of this file is taken to be an include pattern." https://ant.apache.org/manual/Types/fileset.html

When I specifiy this in the pom plugin just tries to execute the command in the files as if it were sql rather than the name of a file to execute. It looks as if this feature is not supported.

...

<build>
    <plugins>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sql-maven-plugin</artifactId>
            <version>1.5</version>

            ...

            <execution>
                <id>create-procs</id>
                <phase>process-test-resources</phase>
                <goals>
                    <goal>execute</goal>
                </goals>
                <configuration>
                    <autocommit>true</autocommit>        
                    <delimiter>/</delimiter>
                    <delimiterType>row</delimiterType>

                    <fileset>
                        <basedir>${sql.root.dir}/sql</basedir>
                        <includes>
                            <includesfile>proc.sql</includesfile>
                        </includes>
                    </fileset>
                </configuration>
            </execution>

            ...

        </plugin>

    </plugins>
    ...
</build>

...

4

0 回答 0