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

  • Home
  • SEARCH
  • 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 8742791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:33:42+00:00 2026-06-13T11:33:42+00:00

I am using the sql-maven-plugin to execute some MySQL scripts on several databases. I

  • 0

I am using the sql-maven-plugin to execute some MySQL scripts on several databases.
I would like to deploy, in the same SQL script, tables, datas, triggers, events and stored procedures.

I have a problem with the line delimiter, because for INSERT or CREATE I use the ;, but for my triggers I have to change the delimiter with DELIMITER //, for example.

I know that the plugin allows changing the delimiter, but it will be applicable for all the script, I want to change the delimiter only for a part of a unique script.

This is my maven configuration:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sql-maven-plugin</artifactId>
    <version>1.5</version>
    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.21</version>
        </dependency>
    </dependencies>
    <configuration>
        <driver>com.mysql.jdbc.Driver</driver>
        <username>${db.user}</username>
        <password>${db.passwd}</password>
        <encoding>UTF-8</encoding>
        <orderFile>ascending</orderFile>
        <keepFormat>true</keepFormat>
        <driverProperties>characterEncoding=utf8,
                          connectionCollation=utf8_general_ci,
                          sql_mode=STRICT_TRANS_TABLES</driverProperties>
    </configuration>
    <executions>
        <execution>
            <id>execution-mysql</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <url>jdbc:mysql://${db.url}:${db.port}</url
                <delimiterType>normal</delimiterType>
                <fileset>
                    <basedir>${project.build.directory}/sql/</basedir>
                    <includes>
                        <include>${file.sql}</include>
                    </includes>
                </fileset>
            </configuration>
        </execution>
     </executions>
</plugin>
  • 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-13T11:33:43+00:00Added an answer on June 13, 2026 at 11:33 am

    You can set your delimeterType to “row” in configuration block.

    <configuration>
    ...
       <delimiterType>row</delimiterType>
    ...
    </configuration>
    

    delimiterType

    Normal means that any occurrence of the delimiter terminate the SQL
    command whereas with row, only a line containing just the delimiter is
    recognized as the end of the command.

    See more at http://mojo.codehaus.org/sql-maven-plugin/execute-mojo.html#delimiterType


    For examlpe: create-proc.sql

    CREATE PROCEDURE ADD_BOOK (IN title VARCHAR(100))
    BEGIN
       -- your sql code 
       INSERT INTO Book (title) VALUES (title);
    END
    ; -- this means the end of the sql command
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the maven-assembly-plugin to produce a zip file for some database scripts. I
Using sql server 2000, I would like to take my production data and put
Using SQL 2005: Taking too much time to execute I want to filter the
I'm making a maven plugin to start, stop and clear a database. I'm using
Using EclipseLink 2.3.2 with static weaving (Maven plugin) against OracleXE. I have the following
I'm trying to write a simple task using Maven: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.3</version> <executions> <execution>
Using: SQL Server 2008 R2 I'd like to write a query that will select
TL;DR version: I want to be able to use the Maven Mojo SQL Plugin
Using SQL Plus, you can run a script with the @ operator from the
I'm currently using Hibernate 3.6.9 with hibernate3-maven-plugin. I use the goal hbm2ddl to generate

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.