I want Maven to execute the sql file, and the database schema it generates will be later used in my program. But it doesn't work, maybe caused by 'DELIMITER'. When I execute 'mvn sql:execute', it prints that
[ERROR] Failed to execute: DELIMITER $$
Here is part of my pom.xml
<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>
<executions>
<execution>
<id>init-schema</id>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
<configuration>
<driver>com.mysql.jdbc.Driver</driver>
<username>root</username>
<password>root</password>
<url>jdbc:mysql://127.0.0.1:3306/?useUnicode=true&characterEncoding=UTF-8</url>
<autocommit>false</autocommit>
<srcFiles>
<srcFile>src/main/sql/jellyjolly-schema.sql</srcFile>
</srcFiles>
</configuration>
</plugin>
Here is part of my sql file
DELIMITER $$
USE `jellyjolly_schema`$$
DROP TRIGGER IF EXISTS `jellyjolly_schema`.`delete_user` $$
USE `jellyjolly_schema`$$
CREATE TRIGGER delete_user
AFTER DELETE
ON jj_users
FOR EACH ROW
BEGIN
## delete the posts that belong to the user
DELETE FROM jj_blog_posts WHERE author_user_id=OLD.user_id;
END
$$
Is it because the keyword 'DELIMITER' is not supported by MySQL Java connector which is invoked by Maven. So how can I solve it?