yogeshmsharma / maven-db-plugin Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/maven-db-plugin
Automatically exported from code.google.com/p/maven-db-plugin
This causes problems when trying to use the plugin in maven 3.
The pom for 1.2-SNAPSHOT in the repository mentions "com.google.com" as groupId
instead of "com.googlecode".
Original issue reported on code.google.com by [email protected]
on 5 Apr 2011 at 3:17
May be in the future could support execution in phase support and multiple
databases??
Currently there is no plugin that support multiple databases to do the exact of
this plugin does. If you need any help, please let me know!
Thanks
Jorge
Original issue reported on code.google.com by [email protected]
on 2 Aug 2011 at 1:31
I don't see a way to skip execution.... Most plugins have a "skip" property
that will allow you to configure a property or just configure an execution
through a profile to skip the execution of a plugins's goals. This makes it
very difficult to have a way for users to skip execution of the database steps
if needed without commenting out sections of the pom file. Please correct me
if I'm wrong, but I don't see anything in the documentation about this.
Original issue reported on code.google.com by [email protected]
on 9 Jul 2013 at 4:07
What steps will reproduce the problem?
1. put a script in the schema dir
2. execute mvn db:schema
3.
What is the expected output? What do you see instead?
should execute the script in the schema dir, but searches in the (empty) data
dir instead
What version of the product are you using? On what operating system?
using version 1.3
Please provide any additional information below.
same thing if executed out of eclipse run configurations
Original issue reported on code.google.com by [email protected]
on 22 Nov 2011 at 2:07
Derby creates its database from the connection string.
jdbc:derby:sandbox;create=true
db:create with no create scripts element complains.
Original issue reported on code.google.com by [email protected]
on 13 Mar 2011 at 6:20
The plugin can't work with unicode wile which start with BOM index. There is
easy solution how to solve this problem. The comons-io (which is used in
project) have ability to work with this type of files.
Changes in pom.xml
@@ -70,11 +70,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.4</source>
- <target>1.4</target>
+ <source>1.6</source>
+ <target>1.6</target>
</configuration>
</plugin>
@@ -99,7 +99,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>1.3.1</version>
+ <version>2.4</version>
</dependency>
Changes in AbstractDBMojo.java:
@@ -19,6 +19,8 @@
import java.util.List;
import java.util.zip.GZIPInputStream;
+import org.apache.commons.io.ByteOrderMark;
+import org.apache.commons.io.input.BOMInputStream;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
@@ -233,14 +240,13 @@
// check encoding
checkEncoding();
-
+
// our file reader
- Reader reader;
- reader = new InputStreamReader(ips, scriptEncoding);
-
+ Reader reader = inputStreamToReaderBOM(ips);
+
// create SQL Statement
Statement st = con.createStatement();
-
+
StringBuffer sql = new StringBuffer();
String line;
BufferedReader in = new BufferedReader(reader);
@@ -323,17 +328,16 @@
ips = new GZIPInputStream(ips);
getLog().info(" file is gz compressed, using gzip stream");
}
-
+
// check encoding
checkEncoding();
-
+
// our file reader
- Reader reader;
- reader = new InputStreamReader(ips, scriptEncoding);
-
+ Reader reader = inputStreamToReaderBOM(ips);
+
// create SQL Statement
Statement st = con.createStatement();
-
+
StringBuffer sql = new StringBuffer();
String line;
BufferedReader in = new BufferedReader(reader);
+
+ private Reader inputStreamToReaderBOM(InputStream in) throws IOException {
+ BOMInputStream bOMInputStream = new BOMInputStream(in,
+ ByteOrderMark.UTF_16LE, ByteOrderMark.UTF_16BE,
+ ByteOrderMark.UTF_32LE, ByteOrderMark.UTF_32BE);
+ ByteOrderMark bom = bOMInputStream.getBOM();
+
+ String charsetName = bom == null ? scriptEncoding :
bom.getCharsetName();
+
+ return new InputStreamReader(new BufferedInputStream(bOMInputStream),
charsetName);
+ }
+
Original issue reported on code.google.com by [email protected]
on 2 Feb 2015 at 7:00
I am planning to use this plugin and so had a very basic question about its
usage - may be just a qucik FAQ to add.
Lets say, we have a existing database with pre-loaded data
1. Should we place Database dump @ - schema scripts i.e src/main/sql/schema
2. Everytime we run db-create it will override the database?
3. Let's suppose we need to add one more column in some x table, where should
we keep that update x.sql script? I guess in update scripts i.e in
src/main/sql/update ?
4. If yes, does everytime we run mvn db:update, it will execute all the scripts
there?
5. This will cause DB errors, like adding same column again and again?
6. Let's suppose we need to add more seed-data in some x table, where should we
keep that x-data.sql? I guess in data scripts i.e in src/main/sql/data?
7. If yes, will same problem as 4 & 5 will occur again?
In nutshell, does the plugin maintain the changelog or handle what is updated
and what is not? So that next time goal runs nothing fails?
I would love to use this plugin and try if I get above usage explained.
Original issue reported on code.google.com by [email protected]
on 23 Apr 2015 at 6:16
I found your maven-db-plugin very useful, but there is no setting for encoding
of sql scripts files.
Some people (like me) are needed to set for example UTF-8 for reading of these
files.
I've explored your code and added optional scriptsEncoding setting locally. Now
it works fine with encoding.
Here is a patch attached for adding this setting.
Please add these changes and deploy new version to repository.
Thanks a lot!
Roman
Original issue reported on code.google.com by [email protected]
on 14 May 2013 at 7:06
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.