You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Borut Bolčina <bo...@gmail.com> on 2008/04/16 14:04:16 UTC

sql-maven-plugin and UTF-8

Hello,

is anyone having problems with
http://mojo.codehaus.org/sql-maven-plugin/when trying to insert data
in utf8 encoding?

It works when inserting with
mysql -u backend -pmasterkey -h localhost portal < insert.sql

but it inserts garbage when using
        <profile>
            <id>create-initial-data</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>
                        <configuration>
                            <!-- <driver>com.mysql.jdbc.Driver</driver>
                                <username>root</username>
                                <password>password</password>
                                <url>jdbc:mysql://${db-host}:3306</url> -->
                            <!-- <skip>false</skip> -->
                        </configuration>
                        <executions>
                            <execution>
                                <id>create-schema-insert-data</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <url>
                                        jdbc:mysql://${db-host}:3306/portal
                                    </url>
                                    <autocommit>true</autocommit>
                                    <srcFiles>
                                        <srcFile>
                                            src/test/resources/create.ddl
                                        </srcFile>
                                        <srcFile>
                                            src/test/resources/insert.sql
                                        </srcFile>
                                    </srcFiles>
                                </configuration>
                            </execution>

                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

Regards,
Borut

Re: sql-maven-plugin and UTF-8

Posted by Dan Tran <da...@gmail.com>.
let me know if it works out for you and I will release it ( ie 1.1 )

-D

2008/4/16 Dan Tran <da...@gmail.com>:
> the site is at http://mojo.codehaus.org <-- here you can find out more
>
> snapshot repo is at http://snapshots.repository.codehaus.org/org/codehaus/mojo/
>
> -D
>
>
> On Wed, Apr 16, 2008 at 1:17 PM, Borut Bolčina <bo...@gmail.com> wrote:
> > What is the repository location, plugin version and plugin source code svn
> > connection?
> >
> > Thanks,
> > Borut
> >
> > 2008/4/16, Dan Tran <da...@gmail.com>:
> >
> > >
> > > <encoding>UTF-8</encoding>
> > >
> > > this is in latest snapshot, please give it a try
> > >
> > >
> > > -D
> > >
> > >
> > >
> > > On Wed, Apr 16, 2008 at 5:07 AM, Manos Batsis
> > > <ma...@geekologue.com> wrote:
> > > >
> > > > Maybe you just need to append a couple of JDBC url params
> > > >
> > > > <url>
> > > >
> > > jdbc:mysql://${db-host}:3306/portal?useUnicode=yes&amp;characterEncoding=UTF-8
> > > > </url>
> > > >
> > > >
> > > > hth,
> > > >
> > > > Manos
> > > >
> > > >
> > > >
> > > > Borut Bolčina wrote:
> > > > > Hello,
> > > > >
> > > > > is anyone having problems with
> > > > > http://mojo.codehaus.org/sql-maven-plugin/when trying to insert data
> > > > > in utf8 encoding?
> > > > >
> > > > > It works when inserting with
> > > > > mysql -u backend -pmasterkey -h localhost portal < insert.sql
> > > > >
> > > > > but it inserts garbage when using
> > > > >        <profile>
> > > > >            <id>create-initial-data</id>
> > > > >            <build>
> > > > >                <plugins>
> > > > >                    <plugin>
> > > > >                        <groupId>org.codehaus.mojo</groupId>
> > > > >                        <artifactId>sql-maven-plugin</artifactId>
> > > > >                        <configuration>
> > > > >                            <!-- <driver>com.mysql.jdbc.Driver</driver>
> > > > >                                <username>root</username>
> > > > >                                <password>password</password>
> > > > >                                <url>jdbc:mysql://${db-host}:3306</url>
> > > -->
> > > > >                            <!-- <skip>false</skip> -->
> > > > >                        </configuration>
> > > > >                        <executions>
> > > > >                            <execution>
> > > > >                                <id>create-schema-insert-data</id>
> > > > >                                <phase>package</phase>
> > > > >                                <goals>
> > > > >                                    <goal>execute</goal>
> > > > >                                </goals>
> > > > >                                <configuration>
> > > > >                                    <url>
> > > >
> > > >                                        jdbc:mysql://${db-host}:3306/portal
> > > > >                                    </url>
> > > > >                                    <autocommit>true</autocommit>
> > > > >                                    <srcFiles>
> > > > >                                        <srcFile>
> > > >
> > > >                                            src/test/resources/create.ddl
> > > > >                                        </srcFile>
> > > > >                                        <srcFile>
> > > >
> > > >                                            src/test/resources/insert.sql
> > > > >                                        </srcFile>
> > > > >                                    </srcFiles>
> > > > >                                </configuration>
> > > > >                            </execution>
> > > > >
> > > > >                        </executions>
> > > > >                    </plugin>
> > > > >                </plugins>
> > > > >            </build>
> > > > >        </profile>
> > > > >
> > > > > Regards,
> > > > > Borut
> > > > >
> > > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
>

Re: sql-maven-plugin and UTF-8

Posted by Dan Tran <da...@gmail.com>.
the site is at http://mojo.codehaus.org <-- here you can find out more

snapshot repo is at http://snapshots.repository.codehaus.org/org/codehaus/mojo/

-D

On Wed, Apr 16, 2008 at 1:17 PM, Borut Bolčina <bo...@gmail.com> wrote:
> What is the repository location, plugin version and plugin source code svn
> connection?
>
> Thanks,
> Borut
>
> 2008/4/16, Dan Tran <da...@gmail.com>:
>
> >
> > <encoding>UTF-8</encoding>
> >
> > this is in latest snapshot, please give it a try
> >
> >
> > -D
> >
> >
> >
> > On Wed, Apr 16, 2008 at 5:07 AM, Manos Batsis
> > <ma...@geekologue.com> wrote:
> > >
> > > Maybe you just need to append a couple of JDBC url params
> > >
> > > <url>
> > >
> > jdbc:mysql://${db-host}:3306/portal?useUnicode=yes&amp;characterEncoding=UTF-8
> > > </url>
> > >
> > >
> > > hth,
> > >
> > > Manos
> > >
> > >
> > >
> > > Borut Bolčina wrote:
> > > > Hello,
> > > >
> > > > is anyone having problems with
> > > > http://mojo.codehaus.org/sql-maven-plugin/when trying to insert data
> > > > in utf8 encoding?
> > > >
> > > > It works when inserting with
> > > > mysql -u backend -pmasterkey -h localhost portal < insert.sql
> > > >
> > > > but it inserts garbage when using
> > > >        <profile>
> > > >            <id>create-initial-data</id>
> > > >            <build>
> > > >                <plugins>
> > > >                    <plugin>
> > > >                        <groupId>org.codehaus.mojo</groupId>
> > > >                        <artifactId>sql-maven-plugin</artifactId>
> > > >                        <configuration>
> > > >                            <!-- <driver>com.mysql.jdbc.Driver</driver>
> > > >                                <username>root</username>
> > > >                                <password>password</password>
> > > >                                <url>jdbc:mysql://${db-host}:3306</url>
> > -->
> > > >                            <!-- <skip>false</skip> -->
> > > >                        </configuration>
> > > >                        <executions>
> > > >                            <execution>
> > > >                                <id>create-schema-insert-data</id>
> > > >                                <phase>package</phase>
> > > >                                <goals>
> > > >                                    <goal>execute</goal>
> > > >                                </goals>
> > > >                                <configuration>
> > > >                                    <url>
> > >
> > >                                        jdbc:mysql://${db-host}:3306/portal
> > > >                                    </url>
> > > >                                    <autocommit>true</autocommit>
> > > >                                    <srcFiles>
> > > >                                        <srcFile>
> > >
> > >                                            src/test/resources/create.ddl
> > > >                                        </srcFile>
> > > >                                        <srcFile>
> > >
> > >                                            src/test/resources/insert.sql
> > > >                                        </srcFile>
> > > >                                    </srcFiles>
> > > >                                </configuration>
> > > >                            </execution>
> > > >
> > > >                        </executions>
> > > >                    </plugin>
> > > >                </plugins>
> > > >            </build>
> > > >        </profile>
> > > >
> > > > Regards,
> > > > Borut
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>

Re: sql-maven-plugin and UTF-8

Posted by Borut Bolčina <bo...@gmail.com>.
What is the repository location, plugin version and plugin source code svn
connection?

Thanks,
Borut

2008/4/16, Dan Tran <da...@gmail.com>:
>
> <encoding>UTF-8</encoding>
>
> this is in latest snapshot, please give it a try
>
>
> -D
>
>
>
> On Wed, Apr 16, 2008 at 5:07 AM, Manos Batsis
> <ma...@geekologue.com> wrote:
> >
> > Maybe you just need to append a couple of JDBC url params
> >
> > <url>
> >
> jdbc:mysql://${db-host}:3306/portal?useUnicode=yes&amp;characterEncoding=UTF-8
> > </url>
> >
> >
> > hth,
> >
> > Manos
> >
> >
> >
> > Borut Bolčina wrote:
> > > Hello,
> > >
> > > is anyone having problems with
> > > http://mojo.codehaus.org/sql-maven-plugin/when trying to insert data
> > > in utf8 encoding?
> > >
> > > It works when inserting with
> > > mysql -u backend -pmasterkey -h localhost portal < insert.sql
> > >
> > > but it inserts garbage when using
> > >        <profile>
> > >            <id>create-initial-data</id>
> > >            <build>
> > >                <plugins>
> > >                    <plugin>
> > >                        <groupId>org.codehaus.mojo</groupId>
> > >                        <artifactId>sql-maven-plugin</artifactId>
> > >                        <configuration>
> > >                            <!-- <driver>com.mysql.jdbc.Driver</driver>
> > >                                <username>root</username>
> > >                                <password>password</password>
> > >                                <url>jdbc:mysql://${db-host}:3306</url>
> -->
> > >                            <!-- <skip>false</skip> -->
> > >                        </configuration>
> > >                        <executions>
> > >                            <execution>
> > >                                <id>create-schema-insert-data</id>
> > >                                <phase>package</phase>
> > >                                <goals>
> > >                                    <goal>execute</goal>
> > >                                </goals>
> > >                                <configuration>
> > >                                    <url>
> >
> >                                        jdbc:mysql://${db-host}:3306/portal
> > >                                    </url>
> > >                                    <autocommit>true</autocommit>
> > >                                    <srcFiles>
> > >                                        <srcFile>
> >
> >                                            src/test/resources/create.ddl
> > >                                        </srcFile>
> > >                                        <srcFile>
> >
> >                                            src/test/resources/insert.sql
> > >                                        </srcFile>
> > >                                    </srcFiles>
> > >                                </configuration>
> > >                            </execution>
> > >
> > >                        </executions>
> > >                    </plugin>
> > >                </plugins>
> > >            </build>
> > >        </profile>
> > >
> > > Regards,
> > > Borut
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: sql-maven-plugin and UTF-8

Posted by Dan Tran <da...@gmail.com>.
<encoding>UTF-8</encoding>

this is in latest snapshot, please give it a try

-D


On Wed, Apr 16, 2008 at 5:07 AM, Manos Batsis
<ma...@geekologue.com> wrote:
>
> Maybe you just need to append a couple of JDBC url params
>
> <url>
> jdbc:mysql://${db-host}:3306/portal?useUnicode=yes&amp;characterEncoding=UTF-8
> </url>
>
>
> hth,
>
> Manos
>
>
>
> Borut Bolčina wrote:
> > Hello,
> >
> > is anyone having problems with
> > http://mojo.codehaus.org/sql-maven-plugin/when trying to insert data
> > in utf8 encoding?
> >
> > It works when inserting with
> > mysql -u backend -pmasterkey -h localhost portal < insert.sql
> >
> > but it inserts garbage when using
> >        <profile>
> >            <id>create-initial-data</id>
> >            <build>
> >                <plugins>
> >                    <plugin>
> >                        <groupId>org.codehaus.mojo</groupId>
> >                        <artifactId>sql-maven-plugin</artifactId>
> >                        <configuration>
> >                            <!-- <driver>com.mysql.jdbc.Driver</driver>
> >                                <username>root</username>
> >                                <password>password</password>
> >                                <url>jdbc:mysql://${db-host}:3306</url> -->
> >                            <!-- <skip>false</skip> -->
> >                        </configuration>
> >                        <executions>
> >                            <execution>
> >                                <id>create-schema-insert-data</id>
> >                                <phase>package</phase>
> >                                <goals>
> >                                    <goal>execute</goal>
> >                                </goals>
> >                                <configuration>
> >                                    <url>
> >                                        jdbc:mysql://${db-host}:3306/portal
> >                                    </url>
> >                                    <autocommit>true</autocommit>
> >                                    <srcFiles>
> >                                        <srcFile>
> >                                            src/test/resources/create.ddl
> >                                        </srcFile>
> >                                        <srcFile>
> >                                            src/test/resources/insert.sql
> >                                        </srcFile>
> >                                    </srcFiles>
> >                                </configuration>
> >                            </execution>
> >
> >                        </executions>
> >                    </plugin>
> >                </plugins>
> >            </build>
> >        </profile>
> >
> > Regards,
> > Borut
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: sql-maven-plugin and UTF-8

Posted by Manos Batsis <ma...@geekologue.com>.
Maybe you just need to append a couple of JDBC url params

<url> 
jdbc:mysql://${db-host}:3306/portal?useUnicode=yes&amp;characterEncoding=UTF-8
</url>


hth,

Manos

Borut Bolčina wrote:
> Hello,
> 
> is anyone having problems with
> http://mojo.codehaus.org/sql-maven-plugin/when trying to insert data
> in utf8 encoding?
> 
> It works when inserting with
> mysql -u backend -pmasterkey -h localhost portal < insert.sql
> 
> but it inserts garbage when using
>         <profile>
>             <id>create-initial-data</id>
>             <build>
>                 <plugins>
>                     <plugin>
>                         <groupId>org.codehaus.mojo</groupId>
>                         <artifactId>sql-maven-plugin</artifactId>
>                         <configuration>
>                             <!-- <driver>com.mysql.jdbc.Driver</driver>
>                                 <username>root</username>
>                                 <password>password</password>
>                                 <url>jdbc:mysql://${db-host}:3306</url> -->
>                             <!-- <skip>false</skip> -->
>                         </configuration>
>                         <executions>
>                             <execution>
>                                 <id>create-schema-insert-data</id>
>                                 <phase>package</phase>
>                                 <goals>
>                                     <goal>execute</goal>
>                                 </goals>
>                                 <configuration>
>                                     <url>
>                                         jdbc:mysql://${db-host}:3306/portal
>                                     </url>
>                                     <autocommit>true</autocommit>
>                                     <srcFiles>
>                                         <srcFile>
>                                             src/test/resources/create.ddl
>                                         </srcFile>
>                                         <srcFile>
>                                             src/test/resources/insert.sql
>                                         </srcFile>
>                                     </srcFiles>
>                                 </configuration>
>                             </execution>
> 
>                         </executions>
>                     </plugin>
>                 </plugins>
>             </build>
>         </profile>
> 
> Regards,
> Borut
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org