You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by lemon dumpling <le...@gmail.com> on 2007/02/04 02:33:28 UTC
Maven2+Hibernate3 Annotation Problem
Hi,
I want to generate database schema to a sql file and feed the schema into my
database. I have hibernate annotations instead of hbm.xml files.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version
<configuration>
<components>
<component>
<name>hbm2ddl</name>
</component>
</components>
<componentProperties>
<drop>true</drop>
<create>true</create>
<configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfile>
</componentProperties>
</configuration>
</plugin>
I believe something is missing. Thanks!
Cheers
RE: Maven2+Hibernate3 Annotation Problem
Posted by Johann Reyes <jr...@hiberforum.org>.
Hello;
That's a base example, the plugin configuration should go something like
this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<componentProperties>
<drop>true</drop>
<create>true</create>
<jdk5>true</jdk5>
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
<outputfilename>schema.sql</outputfilename>
</componentProperties>
</configuration>
</plugin>
Regards
Johann Reyes
-----Original Message-----
From: lemon dumpling [mailto:lemon.dumpling@gmail.com]
Sent: Tuesday, February 06, 2007 8:29 AM
To: Maven Users List
Subject: Re: Maven2+Hibernate3 Annotation Problem
Hi Johann,
Yes, I tried that thing but it always throws no suitable driver exception:
[ERROR] SchemaExport - schema export unsuccessful <java.sql.SQLException: No
sui
table driver>java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
n(DriverManagerConnectionProvider.java:110)
My pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<componentProperties>
<outputfilename>schema.sql</outputfilename>
</componentProperties>
</configuration>
</plugin>
But then if I have something like this, it actually works - it auto connects
to my database and creates the schema:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
</component>
</components>
<componentProperties>
<drop>true</drop>
<create>true</create>
<jdk5>true</jdk5>
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
</componentProperties>
</plugin>
Cheers
On 2/5/07, Johann Reyes <jr...@hiberforum.org> wrote:
>
> Hello
>
> First you need to set up the element outputfilename as seen here:
>
>
>
http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/examples/s
> chema_output.html
>
> Also you need to include the annotated classes in your hibernate.cfg.xml
> file
>
> Regards
>
> Johann Reyes
>
> -----Original Message-----
> From: lemon dumpling [mailto:lemon.dumpling@gmail.com]
> Sent: Saturday, February 03, 2007 8:33 PM
> To: users@maven.apache.org
> Subject: Maven2+Hibernate3 Annotation Problem
>
> Hi,
>
> I want to generate database schema to a sql file and feed the schema into
> my
> database. I have hibernate annotations instead of hbm.xml files.
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.0-SNAPSHOT</version
> <configuration>
> <components>
> <component>
> <name>hbm2ddl</name>
> </component>
> </components>
> <componentProperties>
> <drop>true</drop>
> <create>true</create>
>
>
>
<configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfi
> le>
> </componentProperties>
> </configuration>
> </plugin>
>
> I believe something is missing. Thanks!
>
> Cheers
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven2+Hibernate3 Annotation Problem
Posted by lemon dumpling <le...@gmail.com>.
Thanks for everyone's help! Finally made it work!
Cheers
On 2/7/07, Manos Batsis <ma...@geekologue.com> wrote:
>
>
> <build>
> <extensions>
> <extension>
> <groupId>mysql-connector-java</groupId>
> <artifactId>mysql-connector-java</artifactId>
> <version>5.0.4</version>
> </extension>
> </extensions>
>
>
> hth,
>
> Manos
>
> Quoting lemon dumpling <le...@gmail.com>:
>
> > Hi Johann,
> >
> > Yes, I tried that thing but it always throws no suitable driver
> > exception:
> > [ERROR] SchemaExport - schema export unsuccessful
> > <java.sql.SQLException: No
> > sui
> > table driver>java.sql.SQLException: No suitable driver
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:545)
> > at
> > java.sql.DriverManager.getConnection(DriverManager.java:140)
> > at
> > org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
> > n(DriverManagerConnectionProvider.java:110)
> >
> > My pom.xml:
> >
> > <plugin>
> > <groupId>org.codehaus.mojo</groupId>
> > <artifactId>hibernate3-maven-plugin</artifactId>
> > <version>2.0-SNAPSHOT</version>
> > <configuration>
> > <componentProperties>
> > <outputfilename>schema.sql</outputfilename>
> > </componentProperties>
> > </configuration>
> > </plugin>
> >
> >
> > But then if I have something like this, it actually works - it auto
> > connects
> > to my database and creates the schema:
> >
> >
> > <plugin>
> > <groupId>org.codehaus.mojo</groupId>
> > <artifactId>hibernate3-maven-plugin</artifactId>
> > <version>2.0-SNAPSHOT</version>
> >
> > <configuration>
> > <components>
> > <component>
> > <name>hbm2ddl</name>
> > </component>
> > </components>
> > <componentProperties>
> > <drop>true</drop>
> > <create>true</create>
> > <jdk5>true</jdk5>
> >
> >
>
> <configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
> > </componentProperties>
> > </plugin>
> >
> > Cheers
> >
> >
> >
> > On 2/5/07, Johann Reyes <jr...@hiberforum.org> wrote:
> > >
> > > Hello
> > >
> > > First you need to set up the element outputfilename as seen here:
> > >
> > >
> > >
> >
>
> http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/examples/s
> > > chema_output.html
> > >
> > > Also you need to include the annotated classes in your
> > hibernate.cfg.xml
> > > file
> > >
> > > Regards
> > >
> > > Johann Reyes
> > >
> > > -----Original Message-----
> > > From: lemon dumpling [mailto:lemon.dumpling@gmail.com]
> > > Sent: Saturday, February 03, 2007 8:33 PM
> > > To: users@maven.apache.org
> > > Subject: Maven2+Hibernate3 Annotation Problem
> > >
> > > Hi,
> > >
> > > I want to generate database schema to a sql file and feed the
> > schema into
> > > my
> > > database. I have hibernate annotations instead of hbm.xml files.
> > >
> > > <plugin>
> > > <groupId>org.codehaus.mojo</groupId>
> > > <artifactId>hibernate3-maven-plugin</artifactId>
> > > <version>2.0-SNAPSHOT</version
> > > <configuration>
> > > <components>
> > > <component>
> > > <name>hbm2ddl</name>
> > > </component>
> > > </components>
> > > <componentProperties>
> > > <drop>true</drop>
> > > <create>true</create>
> > >
> > >
> > >
> >
>
> <configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfi
> > > le>
> > > </componentProperties>
> > > </configuration>
> > > </plugin>
> > >
> > > I believe something is missing. Thanks!
> > >
> > > Cheers
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Maven2+Hibernate3 Annotation Problem
Posted by Manos Batsis <ma...@geekologue.com>.
<build>
<extensions>
<extension>
<groupId>mysql-connector-java</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.4</version>
</extension>
</extensions>
hth,
Manos
Quoting lemon dumpling <le...@gmail.com>:
> Hi Johann,
>
> Yes, I tried that thing but it always throws no suitable driver
> exception:
> [ERROR] SchemaExport - schema export unsuccessful
> <java.sql.SQLException: No
> sui
> table driver>java.sql.SQLException: No suitable driver
> at
> java.sql.DriverManager.getConnection(DriverManager.java:545)
> at
> java.sql.DriverManager.getConnection(DriverManager.java:140)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
> n(DriverManagerConnectionProvider.java:110)
>
> My pom.xml:
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.0-SNAPSHOT</version>
> <configuration>
> <componentProperties>
> <outputfilename>schema.sql</outputfilename>
> </componentProperties>
> </configuration>
> </plugin>
>
>
> But then if I have something like this, it actually works - it auto
> connects
> to my database and creates the schema:
>
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.0-SNAPSHOT</version>
>
> <configuration>
> <components>
> <component>
> <name>hbm2ddl</name>
> </component>
> </components>
> <componentProperties>
> <drop>true</drop>
> <create>true</create>
> <jdk5>true</jdk5>
>
>
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
> </componentProperties>
> </plugin>
>
> Cheers
>
>
>
> On 2/5/07, Johann Reyes <jr...@hiberforum.org> wrote:
> >
> > Hello
> >
> > First you need to set up the element outputfilename as seen here:
> >
> >
> >
>
http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/examples/s
> > chema_output.html
> >
> > Also you need to include the annotated classes in your
> hibernate.cfg.xml
> > file
> >
> > Regards
> >
> > Johann Reyes
> >
> > -----Original Message-----
> > From: lemon dumpling [mailto:lemon.dumpling@gmail.com]
> > Sent: Saturday, February 03, 2007 8:33 PM
> > To: users@maven.apache.org
> > Subject: Maven2+Hibernate3 Annotation Problem
> >
> > Hi,
> >
> > I want to generate database schema to a sql file and feed the
> schema into
> > my
> > database. I have hibernate annotations instead of hbm.xml files.
> >
> > <plugin>
> > <groupId>org.codehaus.mojo</groupId>
> > <artifactId>hibernate3-maven-plugin</artifactId>
> > <version>2.0-SNAPSHOT</version
> > <configuration>
> > <components>
> > <component>
> > <name>hbm2ddl</name>
> > </component>
> > </components>
> > <componentProperties>
> > <drop>true</drop>
> > <create>true</create>
> >
> >
> >
>
<configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfi
> > le>
> > </componentProperties>
> > </configuration>
> > </plugin>
> >
> > I believe something is missing. Thanks!
> >
> > Cheers
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven2+Hibernate3 Annotation Problem
Posted by lemon dumpling <le...@gmail.com>.
Hi Johann,
Yes, I tried that thing but it always throws no suitable driver exception:
[ERROR] SchemaExport - schema export unsuccessful <java.sql.SQLException: No
sui
table driver>java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
n(DriverManagerConnectionProvider.java:110)
My pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<componentProperties>
<outputfilename>schema.sql</outputfilename>
</componentProperties>
</configuration>
</plugin>
But then if I have something like this, it actually works - it auto connects
to my database and creates the schema:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
</component>
</components>
<componentProperties>
<drop>true</drop>
<create>true</create>
<jdk5>true</jdk5>
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
</componentProperties>
</plugin>
Cheers
On 2/5/07, Johann Reyes <jr...@hiberforum.org> wrote:
>
> Hello
>
> First you need to set up the element outputfilename as seen here:
>
>
> http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/examples/s
> chema_output.html
>
> Also you need to include the annotated classes in your hibernate.cfg.xml
> file
>
> Regards
>
> Johann Reyes
>
> -----Original Message-----
> From: lemon dumpling [mailto:lemon.dumpling@gmail.com]
> Sent: Saturday, February 03, 2007 8:33 PM
> To: users@maven.apache.org
> Subject: Maven2+Hibernate3 Annotation Problem
>
> Hi,
>
> I want to generate database schema to a sql file and feed the schema into
> my
> database. I have hibernate annotations instead of hbm.xml files.
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.0-SNAPSHOT</version
> <configuration>
> <components>
> <component>
> <name>hbm2ddl</name>
> </component>
> </components>
> <componentProperties>
> <drop>true</drop>
> <create>true</create>
>
>
> <configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfi
> le>
> </componentProperties>
> </configuration>
> </plugin>
>
> I believe something is missing. Thanks!
>
> Cheers
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
RE: Maven2+Hibernate3 Annotation Problem
Posted by Johann Reyes <jr...@hiberforum.org>.
Hello
First you need to set up the element outputfilename as seen here:
http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/examples/s
chema_output.html
Also you need to include the annotated classes in your hibernate.cfg.xml
file
Regards
Johann Reyes
-----Original Message-----
From: lemon dumpling [mailto:lemon.dumpling@gmail.com]
Sent: Saturday, February 03, 2007 8:33 PM
To: users@maven.apache.org
Subject: Maven2+Hibernate3 Annotation Problem
Hi,
I want to generate database schema to a sql file and feed the schema into my
database. I have hibernate annotations instead of hbm.xml files.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version
<configuration>
<components>
<component>
<name>hbm2ddl</name>
</component>
</components>
<componentProperties>
<drop>true</drop>
<create>true</create>
<configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfi
le>
</componentProperties>
</configuration>
</plugin>
I believe something is missing. Thanks!
Cheers
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven2+Hibernate3 Annotation Problem
Posted by lemon dumpling <le...@gmail.com>.
I don't see the file getting created, as well as the table binding...
On 2/4/07, Alejandro Scandroli <al...@gmail.com> wrote:
>
> Hi
>
> It looks good to me. Are you getting any errors?
> Try adding your property file:
> eg.
> <propertyfile>src/main/resources/hibernate.properties</propertyfile>
>
> You can also try:
> <jdk5>true</jdk5>
> <ejb3>true</ejb3>
>
> Alejandro.
>
>
> On 2/4/07, lemon dumpling <le...@gmail.com> wrote:
> > Hi,
> >
> > I want to generate database schema to a sql file and feed the schema
> into my
> > database. I have hibernate annotations instead of hbm.xml files.
> >
> > <plugin>
> > <groupId>org.codehaus.mojo</groupId>
> > <artifactId>hibernate3-maven-plugin</artifactId>
> > <version>2.0-SNAPSHOT</version
> > <configuration>
> > <components>
> > <component>
> > <name>hbm2ddl</name>
> > </component>
> > </components>
> > <componentProperties>
> > <drop>true</drop>
> > <create>true</create>
> >
> >
> <configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfile>
> > </componentProperties>
> > </configuration>
> > </plugin>
> >
> > I believe something is missing. Thanks!
> >
> > Cheers
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
pluginGroups in pom.xml
Posted by Mark Proctor <li...@markproctor.com>.
I'm writting a plugin that is specific to my project, I want the user to
be able to call this plugin outside of the normal lifecycles. I have
seen the documentation on pluginGroups, but I don't want to have to make
the user go through the extra step of creating a settings.xml - is there
anyway to make my plugin in the default search space, out of the box in
my project? i.e. can the pluginGroups element be specific inside of the
pom.xml.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven2+Hibernate3 Annotation Problem
Posted by Alejandro Scandroli <al...@gmail.com>.
Hi
It looks good to me. Are you getting any errors?
Try adding your property file:
eg.
<propertyfile>src/main/resources/hibernate.properties</propertyfile>
You can also try:
<jdk5>true</jdk5>
<ejb3>true</ejb3>
Alejandro.
On 2/4/07, lemon dumpling <le...@gmail.com> wrote:
> Hi,
>
> I want to generate database schema to a sql file and feed the schema into my
> database. I have hibernate annotations instead of hbm.xml files.
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.0-SNAPSHOT</version
> <configuration>
> <components>
> <component>
> <name>hbm2ddl</name>
> </component>
> </components>
> <componentProperties>
> <drop>true</drop>
> <create>true</create>
>
> <configurationfile>src/main/resources/etc/hibernate.cfg.xml</configurationfile>
> </componentProperties>
> </configuration>
> </plugin>
>
> I believe something is missing. Thanks!
>
> Cheers
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org