Questions tagged [sql-maven-plugin]

The sql-maven-plugin is used to execute SQL statements during a Maven build. Use this tag for questions specific about the usage of this plugin.

The sql-maven-plugin is used to execute SQL statements against a database during a Maven build.

32 questions
11
votes
1 answer

Maven: PL/SQL script with sql-maven-plugin throws error PLS-00103

I'm trying to use the sql-maven-plugin to execute a PL/SQL script on an Oracle 11 database. Although the script is valid PL/SQL (as far as I can tell), the execution gives me a PLS-00103 error: The SQL script: (drop_all_tables.sql) BEGIN EXECUTE…
Guillaume
  • 22,694
  • 14
  • 56
  • 70
10
votes
3 answers

H2DB - script SQL ON UPDATE in CREATE TABLE request

How to do an ON UPDATE in a CREATE TABLE request in H2 database. Context: I'm using the sql-maven-plugin (1.5) to generate a table in an h2 database in my project. But when I call the script sql, I have a…
user1029346
  • 101
  • 1
  • 3
7
votes
1 answer

Errors using Maven Mojo sql:execute

TL;DR version: I want to be able to use the Maven Mojo SQL Plugin to create/drop any given table in my DB schema (or load data for those tables) at will via the mvn command-line. How? I'm a long-time Java developer, but for the most part I've been…
Mike
  • 7,994
  • 5
  • 35
  • 44
7
votes
1 answer

Maven: run plugin twice during a phase, interleaved with another plugin

For our end-2-end test we need to execute the following logical flow: Create and set up e2e schema (user) in the database (pre-integration-test) Run Liquibase to initially populate the schema (pre-integration-test) Add e2e-specific test data to the…
yktoo
  • 2,696
  • 1
  • 23
  • 35
7
votes
1 answer

Maven plugin java.library.path

The maven-surefire-plugin supports using the java.library.path property by means of the configuration option. I need to pass the java.library.path property to sql-maven-plugin (which doesn't have an configuration option) in order…
adrianboimvaser
  • 2,651
  • 1
  • 22
  • 30
5
votes
2 answers

Maven: Read encrypted password from settings.xml in pom.xml

I am trying to use an encrypted password in my settings.xml. I have in my pom.xml a plugin connecting to the database, usin sql-maven-plugin: org.codehaus.mojo sql-maven-plugin
Daniel Hernández
  • 4,078
  • 6
  • 27
  • 38
4
votes
1 answer

sql-maven-plugin with multiple delimiters

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…
Damien
  • 352
  • 3
  • 11
3
votes
1 answer

Skip sql-maven-plugin execution from command line

How can I prevent sql-maven-plugin from executing when doing mvn clean install from the command line? I cannot touch the pom file.
George
  • 7,206
  • 8
  • 33
  • 42
2
votes
1 answer

Maven surefire plugin, setting and getting system properties during build lifecycle

I'm trying to come up with a parallel maven test execution for integration tests. Using sql-maven-plugin to create a test database before test execution starts, in conjunction with maven surefire plugin parameters and parallel execution, seems like…
Wrench
  • 4,070
  • 4
  • 34
  • 46
2
votes
1 answer

Maven SQL plugin: execute scripts conditionally

On a Java project, I use the SQL Maven Plugin to execute SQL scripts with a given profile. Here is a part of my pom.xml : import_oracle org.codehaus.mojo
Pierre
  • 2,552
  • 5
  • 26
  • 47
2
votes
1 answer

Populating DB with Maven

Let's say that my standard configration in Maven is: compile, test and package - do their normal thing pre-integration-test: Generate DB schema scripts (maven-antrun-plugin with concat) Run those scripts on DB (sql-maven-plugin) Run a custom Java…
Konrad Garus
  • 53,145
  • 43
  • 157
  • 230
2
votes
1 answer

sql-maven-plugin throws SQL syntax error for H2 stored procedure definition

I try to install a stored procedure in an h2 database (v. 1.3.170) using the sql-maven-plugin version 1.5. The offending SQL statement looks like this: CREATE ALIAS GET_DATA AS $$ ResultSet getData(Connection conn, String id) { return null; …
tomsen_san
  • 31
  • 4
2
votes
0 answers

sql-maven-plugin not creating tables in correct mysql database

I have tried many different variations of the code below (including extracting the Database connection details into the tag), but no matter what I do, the table is still created in the wrong database. I have also tried to execute the "use autofi"…
Sean Charles
  • 267
  • 3
  • 18
1
vote
1 answer

How to create a SQL dump using sql-maven-plugin

I use the sql-maven-plugin to handle the database before and after the maven tests ran. The examples are pretty straight forward in regards to dropping/ creating schema, populating. How can I create a SQL dump of the db using this plugin?
special0ne
  • 6,063
  • 17
  • 67
  • 107
1
vote
2 answers

How disable sql-maven-plugin file copy to temp folder?

Here is a piece of plugin configuration: src${file.separator}integration-test${file.separator}resources${file.separator}sql${file.separator}schema.sql
Cherry
  • 31,309
  • 66
  • 224
  • 364
1
2 3