Hi Marco,

 

It appears that the hibernate.cfg.xml is required only when generating
schema (ie hibernate3:export-schema).

It does not appear to need hibernate.properties. But I do remember some
tools & third party applications needing the hibernate.properties.

 

What command are you running to generate your source files from hbm.xml
files.

 

Just a note I am not generating my hbm files using xdoclet.

 

Thanks

Lakshman

  _____  

From: Marco Mistroni [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 24 August 2006 3:04 PM
To: Lakshman Srilakshmanan
Subject: Re: maven2 / hibernate3- schema-export

 

Hello Lakshman,
 thanks for your reply..
i have one little question: does the plugin work even if i have an
hibernate.properties instead of hibernate.cfg.xml?

thanks nad regards
 marco

On 8/24/06, Lakshman Srilakshmanan
<[EMAIL PROTECTED]> wrote:

Hi Marco,

Your hbm.xml file must be located in src/main/resources

When you run mvn clean resources:resources hibernate3:hbm2java the
hbm.xml files are copied into target/classes and then the java source
files are generated. 

Alternatively you could generate the hbm.xml file directly into
target/classes and run mvn hibernate3:hbm2java.

Thanks
Lakshman
________________________________________
From: Marco Mistroni [mailto: [EMAIL PROTECTED]
Sent: Wednesday, 23 August 2006 11:12 PM
To: Lakshman Srilakshmanan
Subject: Re: maven2 / hibernate3- schema-export

Hi Lakshman,
htanx for the link! i managed to build it and use it but i am still
having problems .. 
i am generating hbm.xml files out of my annotated classes using xdoclet,
and somehow i'd need to tell to the plugin where to find the .hbm.xml
.....
how can i configure that?

thanks and regards
marco
On 8/23/06, Lakshman Srilakshmanan <
[EMAIL PROTECTED]> wrote:
Hi Marco

The link I provided is for anonymous access as shown below.

Happy hunting :)

svn co
http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/maven-hibernate3/hi
bernate3-maven-plugin hibernate3-maven-plugin 

Ahibernate3-maven-plugin/src
Ahibernate3-maven-plugin/src/main
Ahibernate3-maven-plugin/src/main/java
Ahibernate3-maven-plugin/src/main/java/org
Ahibernate3-maven-plugin/src/main/java/org/codehaus
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo 
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/Hibe
rnateExporterMojo.java
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/conv
erter 
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/conv
erter/ProviderConfigurationConverter.java
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/Hbm2JavaGeneratorMojo.java 
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/Hbm2CfgXmlExporterMojo.java
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/SchemaExportMojo.java
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/SchemaUpdateMojo.java 
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/Hbm2DDLExporterMojo.java
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/Hbm2DocExporterMojo.java
Ahibernate3-maven-plugin/src/main/java/org/codehaus/mojo/hibernate3/expo
rter/Hbm2HbmXmlExporterMojo.java 
Ahibernate3-maven-plugin/src/main/resources
Ahibernate3-maven-plugin/src/main/resources/META-INF
Ahibernate3-maven-plugin/src/main/resources/META-INF/plexus
Ahibernate3-maven-plugin/src/main/resources/META-INF/plexus/components.x
ml 
Ahibernate3-maven-plugin/src/site
Ahibernate3-maven-plugin/src/site/site.xml
Ahibernate3-maven-plugin/src/site/apt
Ahibernate3-maven-plugin/src/site/apt/howto.apt
Ahibernate3-maven-plugin/src/site/apt/confighibernate.apt 
Ahibernate3-maven-plugin/src/site/apt/configoutputdirectory.apt
Ahibernate3-maven-plugin/pom.xml
U hibernate3-maven-plugin
Thanks
Lakshman
________________________________________
From: Marco Mistroni [mailto: [EMAIL PROTECTED]
Sent: Tuesday, 22 August 2006 11:25 PM
To: Lakshman Srilakshmanan
Subject: Re: maven2 / hibernate3- schema-export

Hello Lakshman,
i didnt manage to donwload the plugin... :( 

any links to SVN for anonymous access?

thanks and regards
marco
On 8/22/06, Marco Mistroni <[EMAIL PROTECTED]> wrote:
Hello Lakshman,
thanx very much!!! i will surely try i tout and by end of to day i'll
get back to tell you how it went 

thanx a lot and regards
Marco

On 8/22/06, Lakshman Srilakshmanan
<[EMAIL PROTECTED]> wrote:
Hi Marco,

No problem.

I had to download hibernate3 plugin from
http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/maven-hibernate3
and compile it locally before I could get it to work. 

Besides the command I ran are
mvn clean resources:resources hibernate3:hbm2java
mvn clean resources:resources hibernate3:schema-export

Hope it helps.

<build>
<plugins>
<plugin> 
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version> 
<executions>
<execution>
<configuration>
<hibernate>
<configurationFile>/src/main/resources/hibernate.cfg.xml</configurationF
ile>
</hibernate>
<outputDirectory> 
<hbm2cfgxml>src/main/resources</hbm2cfgxml>
<!-- hbm2dll>target/hibernate3/sql</hbm2dll -->
</outputDirectory>
<outputFile>SMS.sql</outputFile>
</configuration> 
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>jdbc.jtds</groupId>
<artifactId>jtds</artifactId>
<version> 1.2</version>
<!--
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.4</version>
-->
</extension> 
</extensions>
</build>



Thanks
Lakshman
________________________________________
From: Marco Mistroni [mailto:[EMAIL PROTECTED] ]
Sent: Monday, 21 August 2006 9:00 PM 
To: Lakshman Srilakshmanan
Subject: Re: maven2 / hibernate3- schema-export

Hi Lakshman,
thanx fo ryour reply......
my main problem is that i canont even get the schema-export goal to be
executed....... that is why i m little 
lost..
would you mind sending me a copy of your <build> section of your pom.xml
(if it is not too confidential) so that i can try to get it at run, even
with errors?

thanks in advance and regards
marco 

PS if i'd run mvn install, i suppose the schema-export goal should be
executed as part of the install.. am i correct?
On 8/21/06, Lakshman Srilakshmanan <
[EMAIL PROTECTED]> wrote:
Hi Marco,

As we don't know what problems you are having, I am taking a stab in the
dark.

Have you included the dependency jars
ie
<dependency> 
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version> 3.1.2</version>
</dependency>

<dependency>
<groupId>hsqldb</groupId> 
<artifactId>hsqldb</artifactId>
<version> 1.8.0.4</version>
</dependency>


<extensions>
<extension>
<groupId>hsqldb</groupId> 
<artifactId>hsqldb</artifactId>
<version>1.8.0.4</version>
</extension>
</extensions>

Have you also configured the driver and url in your hibernate.cfg.xml

Thanks
Lakshman


> -----Original Message-----
> From: Marco Mistroni [mailto:[EMAIL PROTECTED]
> Sent: Monday, 21 August 2006 4:21 AM 
> To: Maven Users List
> Subject: maven2 / hibernate3- schema-export
>
> hi all
> i am trying to generate a schema out of my hibernate classes but i
can't
> manage....
>
> i am trying first to generate hbm.xml files using xdoclet, and then i
am
> trying to generate a schema using hibernate3 plugin
>
> here's my pom.xml (only relevant part of build)
>
> <build>
>
> <plugins> 
> <plugin>
><artifactId>xdoclet-maven-plugin</artifactId>
><groupId>org.codehaus.mojo</groupId>
><executions>
><execution>
> <phase>generate-sources</phase> 
><goals>
> <goal>xdoclet</goal>
></goals>
><configuration>
> <tasks>
> <echo message="Generating HBM files from java source
to
> ${basedir}/src/main/resources"/> 
> <hibernatedoclet
destdir="${basedir}/src/main/resources/"
> excludedtags="@version,@author,@todo,@see,@desc"verbose="true">
><fileset dir="${basedir}/src/main/java" 
> includes="**/hibernate/*.java"/>
><hibernate version="3.0" />
> </hibernatedoclet>
> </tasks>
> </configuration>
></execution>
> </executions>
> </plugin>
><plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>1.0-SNAPSHOT </version>
> <configuration>
> <hibernate>
>
>
<configurationFile>/src/main/resources/hibernate.properties</configurati
onFile>
> </hibernate>
> <outputDirectory> 
> <hbm2ddl>src/main/resources</hbm2ddl>
> </outputDirectory>
> </configuration>
> </plugin>
></plugins>
> </build>
>
>
> can anyone tell me what am i doing wrong?? 
>
> thanks in advance and regards
> Marco


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







 

Reply via email to