Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9098799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:26:58+00:00 2026-06-17T00:26:58+00:00

I would like to ask some help regarding sql-mvn-plugin . According to the documentation

  • 0

I would like to ask some help regarding sql-mvn-plugin. According to the documentation if the pom.xml file does not have anything about the file order – orderFile tag – than the files will be executed in the exact order as they are listed. But it is not true! If I remove the orderFile tag than the files will be executed by ascending by default.

To be honest, I wanted to use this plugin to create the database and import data during installation. Due to the fact I’m working more than 20 tables – the scripts, the table and the sequence and the constraints, are separated into individual files – I can not work files which do not have meaningful name. It would be the hell itself and using this plugin would be worthless. On the other hand I don’t want to have this step outside from maven because in my head the maven is the tool to build, to test and deploy my application and the tool to avoid the script hell.

As you can see in the sample below the execution order is not defined, and despite this fact during execution the first file which is executed the *procedures/test_activate_all_partners.sql*, which is the penultimate in the file order! In my understanding the first executed file should be the *tables/datapoint_component_types/table.sql*.

My pom.xml:

              <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sql-maven-plugin</artifactId>
                <version>1.5</version>
                <dependencies>
                    <dependency>
                        <groupId>postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>9.1-901.jdbc4</version>
                    </dependency>            
                </dependencies>
                <configuration>
                    <driver>org.postgresql.Driver</driver>
                    <url>jdbc:postgresql://localhost:5432/database</url>
                    <username>postgres</username>
                    <password>postgres</password>
                </configuration>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <delimiter>/</delimiter>
                            <delimiterType>normal</delimiterType>
                            <autocommit>true</autocommit>
                            <fileset>
                                <!-- at home -->
                                <basedir>d:/PRIVAT/Projects/java/bigProject/</basedir>
                                <includes>
                                    <!-- tables -->
                                    <include>tables/datapoint_component_types/table.sql</include>
                                    <include>tables/datapoint_datapoint_components/table.sql</include>
                                    <include>tables/datapoint_java_result_types/table.sql</include>
                                    <include>tables/datapoint_postgres_result_types/table.sql</include>
                                    <include>tables/datapoint_result_types/table.sql</include>
                                    <include>tables/datapoints/table.sql</include>
                                    <include>tables/datatype_descs/table.sql</include>
                                    <include>tables/datatypes/table.sql</include>
                                    <include>tables/disabled_period/table.sql</include>
                                    <include>tables/file_extensions/table.sql</include>
                                    <include>tables/logs/table.sql</include>
                                    <include>tables/partner_datatypes/table.sql</include>
                                    <include>tables/partner_processes/table.sql</include>
                                    <include>tables/partner_protocols/table.sql</include>
                                    <include>tables/partner_protocols_attributes_details/table.sql</include>
                                    <include>tables/partners/table.sql</include>
                                    <include>tables/process_step/table.sql</include>
                                    <include>tables/process_step_actions/table.sql</include>
                                    <include>tables/process_steps_param/table.sql</include>
                                    <include>tables/process_steps_partner_processes/table.sql</include>
                                    <include>tables/processes/table.sql</include>
                                    <include>tables/protocol_attributes/table.sql</include>
                                    <include>tables/protocols/table.sql</include>
                                    <include>tables/result_tables/table.sql</include>
                                    <include>tables/valid_period/table.sql</include>
                                    <!-- constrains -->
                                    <include>tables/datapoint_component_types/sequences.sql</include>
                                    <include>tables/datapoint_datapoint_components/sequences.sql</include>
                                    <include>tables/datapoint_java_result_types/sequences.sql</include>
                                    <include>tables/datapoint_postgres_result_types/sequences.sql</include>
                                    <include>tables/datapoint_result_types/sequences.sql</include>
                                    <include>tables/datapoints/sequences.sql</include>
                                    <include>tables/datatype_descs/sequences.sql</include>
                                    <include>tables/datatypes/sequences.sql</include>
                                    <include>tables/disabled_period/sequences.sql</include>
                                    <include>tables/file_extensions/sequences.sql</include>
                                    <include>tables/logs/sequences.sql</include>
                                    <include>tables/partner_datatypes/sequences.sql</include>
                                    <include>tables/partner_processes/sequences.sql</include>
                                    <include>tables/partner_protocols/sequences.sql</include>
                                    <include>tables/partner_protocols_attributes_details/sequences.sql</include>
                                    <include>tables/partners/sequences.sql</include>
                                    <include>tables/process_step/sequences.sql</include>
                                    <include>tables/process_step_actions/sequences.sql</include>
                                    <include>tables/process_steps_param/sequences.sql</include>
                                    <include>tables/process_steps_partner_processes/sequences.sql</include>
                                    <include>tables/processes/sequences.sql</include>
                                    <include>tables/protocol_attributes/sequences.sql</include>
                                    <include>tables/protocols/sequences.sql</include>
                                    <include>tables/result_tables/sequences.sql</include>
                                    <include>tables/valid_period/sequences.sql</include>
                                    <!-- sequences -->
                                    <include>tables/datapoint_component_types/constraints.sql</include>
                                    <include>tables/datapoint_datapoint_components/constraints.sql</include>
                                    <include>tables/datapoint_java_result_types/constraints.sql</include>
                                    <include>tables/datapoint_postgres_result_types/constraints.sql</include>
                                    <include>tables/datapoint_result_types/constraints.sql</include>
                                    <include>tables/datapoints/constraints.sql</include>
                                    <include>tables/datatype_descs/constraints.sql</include>
                                    <include>tables/datatypes/constraints.sql</include>
                                    <include>tables/disabled_period/constraints.sql</include>
                                    <include>tables/file_extensions/constraints.sql</include>
                                    <include>tables/logs/constraints.sql</include>
                                    <include>tables/partner_datatypes/constraints.sql</include>
                                    <include>tables/partner_processes/constraints.sql</include>
                                    <include>tables/partner_protocols/constraints.sql</include>
                                    <include>tables/partner_protocols_attributes_details/constraints.sql</include>
                                    <include>tables/partners/constraints.sql</include>
                                    <include>tables/process_step/constraints.sql</include>
                                    <include>tables/process_step_actions/constraints.sql</include>
                                    <include>tables/process_steps_param/constraints.sql</include>
                                    <include>tables/process_steps_partner_processes/constraints.sql</include>
                                    <include>tables/processes/constraints.sql</include>
                                    <include>tables/protocol_attributes/constraints.sql</include>
                                    <include>tables/protocols/constraints.sql</include>
                                    <include>tables/result_tables/constraints.sql</include>
                                    <include>tables/valid_period/constraints.sql</include>
                                    <!-- procedures -->
                                    <include>procedures/test_activate_all_partners.sql</include>
                                    <!-- testdata -->
                                    <include>testdata/data.sql</include>
                                </includes>
                            </fileset>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

The output:

d:/PRIVAT/Projects/java/bigProject>mvn sql:execute
[INFO] Scanning for projects...
...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building EJB 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sql-maven-plugin:1.5:execute (default-cli) @ DiLibCoreEJB ---
[INFO] Executing file: sql\procedures\test_activate_all_partners.sql
[INFO] Executing file: sql\tables\datapoints\constraints.sql
[ERROR] Failed to execute:
 ALTER TABLE
 datapoints
 ADD
 CONSTRAINT datapoints_pkey PRIMARY KEY (datapoint_id );

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.503s
[INFO] Finished at: Sun Jan 06 17:49:40 CET 2013
[INFO] Final Memory: 4M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (default-cli) on project DiLibCoreEJB: ERROR: relation "datapoints" does not exist -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
d:/PRIVAT/Projects/java/bigProject>

Thanks for any help in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:26:59+00:00Added an answer on June 17, 2026 at 12:26 am

    Maybe I misunderstand a things but an excerpt from the docs says:

    File(s) containing SQL statements to load. Only use a Fileset if you want to use ant-like filepatterns, otherwise use srcFiles. The order is based on a matching occurrence while scanning the directory (not the order of includes!)

    which means that you should use srcFiles instead of includes. Means something like this:

    <configuration>
      <srcFiles>
        <srcFile>first.sql</srcFile>
        <srcFile>second.sql</srcFile>
        <srcFile>a.sql</srcFile>
        ..
      </srcFiles>
      .
    </configuration>
    

    BTW: absolute path in you configuration:

    d:/PRIVAT/Projects/java/bigProject/
    

    should be avoided.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning! I would like to ask some help from you guys on how
I'm still fairly new to mysql and would like to ask for some help.
I would like to ask for your help for constructing a single ORACLE SQL
i would like to ask some help from you guys. i am making a
I would like to ask you for some help. How can I use an
I would like to ask for some help to understand an error report. I
Hello I would like to ask your help regarding javascript code, how do I
Hello fellow programmers, I would like to ask for some help with regards to
I would like to ask some help. This is not homework but it is
I would like to ask some Drupaler for help. Is it possible to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.