Re: Hibernate 3.6.0 and Maven
Hello Ryan You just need this: dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.6.0.Final/version /dependency Johann On Tue, Jan 18, 2011 at 11:25 AM, Ryan Cuprak rcup...@me.com wrote: Does anyone have a working pom file for Hibernate 3.5.x or 3.6.x? This is what I have now: dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.5.3-Final/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-entitymanager/artifactId version3.5.3-Final/version /dependency [ERROR] Failed to execute goal on project ctjava: Could not resolve dependencies for project net.cuprak.web:ctjava:war:1.0-SNAPSHOT: Could not find artifact org.hibernate:hibernate:jar:3.5.3-Final in jboss-public-repository-group ( https://repository.jboss.org/nexus/content/groups/public-jboss/) - [Help 1] I look at the repository and it looks to me like that dependency exists. I am trying to get off of Hibernate 3.2.5. Thanks, -Ryan - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Maven filter and hsqldb mem hibernate.hbm2ddl.auto
Hello Stephane Do you want to do something like this?? https://svn.codehaus.org/mojo/trunk/sandbox/hibernate3-maven-plugin/src/it/m hibernate-65 Johann Reyes -Original Message- From: Stephane Eybert [mailto:mittiprove...@yahoo.se] Sent: Sunday, May 09, 2010 4:06 PM To: users@maven.apache.org Subject: Re: Maven filter and hsqldb mem hibernate.hbm2ddl.auto Hi Jemos, Thanks for your reply. But I wonder how come the file in the target directory shows all the properties being filtered fine. A look at the file core/target/classes/spring-hibernate.xml shows the property place holders replaced by the corresponding values. But a look at the file core/target/test-classes/spring-hibernate.xml shows that the property place holders were NOT replaced. So, the filtering works in a way that escapes me... It seems to filter something, creating a filtered file at core/target/classes/spring-hibernate.xml but not doing it for the file core/target/test-classes/spring-hibernate.xml What puzzles me is that I only run an integration test with the command: mvn clean test -Pitest Here are the generated files in the target directory, one in classes/ filtered fine and the other one in test-classes not filtered: http://old.nabble.com/file/p28505207/spring-hibernate.xml spring-hibernate.xml http://old.nabble.com/file/p28505207/spring-hibernate.xml spring-hibernate.xml -- View this message in context: http://old.nabble.com/Maven-filter-and-hsqldb-mem-hibernate.hbm2ddl.auto-tp2 8504415p28505207.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Hibernate 3 Plugin
Hello Neil I think the problem is it doesn't find the persistence.xml because it isn't the standard META-INF/persistence.xml as per the hibernatools documentation: https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html jpaconfiguration will simply just try and auto-configure itself based on the available classpath, e.g. look for META-INF/persistence.xml. Try moving your persistence.xml to the META-INF directory and try it again Regards Johann Reyes -Original Message- From: Neil Chaudhuri [mailto:nchaudh...@potomacfusion.com] Sent: Thursday, August 13, 2009 2:26 PM To: users@maven.apache.org Subject: Hibernate 3 Plugin I am using Maven with JPA/Hibernate, and I would like to generate a DDL file to give to my DBAs. I am using the Hibernate 3 Maven plugin to do this. However, I keep getting the error [ERROR] Persistence unit not found: 'myapp'. Here is the relevant portion of the POM: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.2/version configuration components component namehbm2ddl/name implementationjpaconfiguration/implementation /component /components componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile persistenceunitmyapp/persistenceunit outputfilenamemyapp.sql/outputfilename formattrue/format /componentProperties /configuration dependencies dependency groupIdcom.oracle.jdbc/groupId artifactIdojdbc6/artifactId version11.1.0.7.0/version /dependency /dependencies /plugin Here is the persistence.xml founf in src/main/resources as well as target/classes: persistence-unit name=myapp transaction-type=RESOURCE_LOCAL providerorg.hibernate.ejb.HibernatePersistence/provider jta-data-sourceMYAPP_DS/jta-data-source properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect/ property name=hibernate.cache.provider_class value=org.hibernate.cache.HashtableCacheProvider/ /properties /persistence-unit The files are where they are supposed to be, and surely the plugin knows to look in the target folder for everything. I would appreciate any insight into what the issue might be. Thanks. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Hibernate 3 Plugin
Hello Neil I think the problem is it doesn't find the persistence.xml because it isn't the standard META-INF/persistence.xml as per the hibernatools documentation: https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html jpaconfiguration will simply just try and auto-configure itself based on the available classpath, e.g. look for META-INF/persistence.xml. Try moving your persistence.xml to the META-INF directory and try it again Regards Johann Reyes -Original Message- From: Neil Chaudhuri [mailto:nchaudh...@potomacfusion.com] Sent: Thursday, August 13, 2009 2:26 PM To: users@maven.apache.org Subject: Hibernate 3 Plugin I am using Maven with JPA/Hibernate, and I would like to generate a DDL file to give to my DBAs. I am using the Hibernate 3 Maven plugin to do this. However, I keep getting the error [ERROR] Persistence unit not found: 'myapp'. Here is the relevant portion of the POM: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.2/version configuration components component namehbm2ddl/name implementationjpaconfiguration/implementation /component /components componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile persistenceunitmyapp/persistenceunit outputfilenamemyapp.sql/outputfilename formattrue/format /componentProperties /configuration dependencies dependency groupIdcom.oracle.jdbc/groupId artifactIdojdbc6/artifactId version11.1.0.7.0/version /dependency /dependencies /plugin Here is the persistence.xml founf in src/main/resources as well as target/classes: persistence-unit name=myapp transaction-type=RESOURCE_LOCAL providerorg.hibernate.ejb.HibernatePersistence/provider jta-data-sourceMYAPP_DS/jta-data-source properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect/ property name=hibernate.cache.provider_class value=org.hibernate.cache.HashtableCacheProvider/ /properties /persistence-unit The files are where they are supposed to be, and surely the plugin knows to look in the target folder for everything. I would appreciate any insight into what the issue might be. Thanks. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Hibernate3 plugin : problem with mapping generatting
Hi That's explained here http://www.velocityreviews.com/forums/t298010-jboss-ide-using-hibernate-tool s-getting-jdbcbinderexception.html Basically you need to specify your schema in a hibernate.reveng.xml file. Regards Johann Reyes -Original Message- From: MedElb [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 10:15 AM To: Maven Users List Subject: Hibernate3 plugin : problem with mapping generatting Hi all i'm using Hibernate3 plugin for generation mapping classes and HBM for an oracle schema the probleme that the goal mvn hibernate3:hbm2cfgxml or the the other vlable goal checks also system table and the exceution take many time, at the and i get that trace error : 16:05:50,780 DEBUG org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [SYS._ALL_INSTANTIATION_DDL.DDL_TEXT t:CLOB l: 255 p:19 s:2 n:true id:false] to [clob] 16:05:50,780 DEBUG org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [SYS._ALL_INSTANTIATION_DDL.DDL_NUM t:NUMERIC l:255 p:22 s:0 n:false id:false] to [big_decimal] 16:05:50,780 DEBUG org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy - Default type found for [SYS._ALL_INSTANTIATION_DDL.PHASE t:NUMERIC l: 255 p:22 s:0 n:false id:false] to [big_decimal] 16:05:50,780 INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:@oracle:thin:@url:1521:SIDNAME [INFO] [ERROR] FATAL ERROR [INFO] [INFO] Duplicate class name 'AllRepcolumn' generated for 'org.hibernate.mapping.Table(SYS._ALL_REPCOLUMN)'. Same name where generated for 'org.hibern ate.mapping.Table(SYS._ALL_REPCOLUMN)' [INFO] [INFO] Trace org.hibernate.cfg.JDBCBinderException: Duplicate class name 'AllRepcolumn' generated for 'org.hibernate.mapping.Table(SYS._ALL_REPCOLUMN)'. Same name where generated for 'org.hibernate.mapping.Table(SYS._ALL_REPCOLUMN)' at org.hibernate.cfg.JDBCBinder.createPersistentClasses(JDBCBinder.java:166) at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfigu ration.java:42) at org.codehaus.mojo.hibernate3.configuration.JDBCComponentConfiguration.doConf iguration(JDBCComponentConfiguration.java:67) at org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfiguration.ge tConfiguration(AbstractComponentConfiguration.java:56) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.configureExporter(Hiberna teExporterMojo.java:197) at org.codehaus.mojo.hibernate3.exporter.Hbm2CfgXmlExporterMojo.configureExport er(Hbm2CfgXmlExporterMojo.java:62) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.doExecute(HibernateExport erMojo.java:270) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporter Mojo.java:149) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:447) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:493) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:463) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126) at org.apache.maven.cli.MavenCli.main(MavenCli.java:282) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] [INFO] Total time: 3 minutes 23 seconds [INFO] Finished at: Tue Aug 26 16:05:50 CEST 2008 16:05:51,021 INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up
RE: hibernate3 maven2 plugin problem
Hello Renu That stills looks that is looking for the JDBC driver. Refer to the bottom of this page: http://mojo.codehaus.org/hibernate3/hibernate3-maven-plugin/usage.html Johann Reyes -Original Message- From: Renu Gupta [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 6:48 AM To: Maven Users List Subject: RE: hibernate3 maven2 plugin problem Hey thanx for ur help.. :) But I m still getting error. :( [DEBUG] Setting context classloader for plugin to: /plugins/org.codehaus.mojo:hibernate3-maven-plugin:[EMAIL PROTECTED]/thread:mai n (instance is: ClassRealm[/plugins/org.codehaus.mojo:hibernate3-maven-plugin:[EMAIL PROTECTED] /thread:main, parent: ClassRealm[plexus.core, parent: null]]) 16:10:24,279 INFO org.hibernate.cfg.Environment - Hibernate 3.2.0.cr5 16:10:24,310 INFO org.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=com.mysql.jdbc.Driver} 16:10:24,310 INFO org.hibernate.cfg.Environment - Bytecode provider name : cglib 16:10:24,342 INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling [DEBUG] basedir: F:\Documents and Settings\rvgupta\eclipsemavenworkspace\trial-plugin 16:10:24,795 INFO org.hibernate.cfg.Configuration - configuring from file: hibernate.cfg.xml [INFO] Configuration XML file loaded: F:\Documents and Settings\rvgupta\eclipsemavenworkspace\trial-plugin\src\main\resources\hiber nate.cfg.xml 16:10:25,201 INFO org.hibernate.cfg.JDBCMetaDataConfiguration - Ignoring null mapping 16:10:25,201 INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null [INFO] src/main/resources/database.properties not found within the project. Trying absolute path. [INFO] No hibernate properties file loaded. 16:10:25,326 INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!) 16:10:25,326 INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20 16:10:25,326 INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false 16:10:25,373 INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/firsthibernate 16:10:25,373 INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=} 16:10:25,389 WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata 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.getConnection(Drive rManagerConnectionProvider.java:110) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1929) at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfigu ration.java:38) at org.codehaus.mojo.hibernate3.configuration.JDBCComponentConfiguration.doConf iguration(JDBCComponentConfiguration.java:67) at org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfiguration.ge tConfiguration(AbstractComponentConfiguration.java:37) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLE xporterMojo.java:87) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporter Mojo.java:140) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:577) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:498) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForPro ject(DefaultLifecycleExecutor.java:265) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:191) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:149) at org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223) at org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:3 04) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1) at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.ja va:903) at org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbe dder.java:304) at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176) at org.apache.maven.cli.MavenCli.main(MavenCli.java:63) at org.apache.maven.cli.MavenCli.main(MavenCli.java:52) 16
RE: hibernate3 maven2 plugin problem
Hello Renu Yes, that's correct. That's another way, I just posted the form that was documented in the site. Regards Johann -Original Message- From: Renu Gupta [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 9:32 AM To: Maven Users List Subject: RE: hibernate3 maven2 plugin problem Hey Johann, Thanx for ur help :) It worked out.But, for ur knowledge I didn't had to add any extension tag in my pom. Just had to add mysql java connector dependency in plugin. Here is my pom: project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion groupIdhibernate/groupId artifactIdtrial-plugin/artifactId packagingmaven-plugin/packaging version0.0.1-SNAPSHOT/version nametrial-plugin Maven Mojo/name urlhttp://maven.apache.org/url dependencies dependency groupIdorg.apache.maven/groupId artifactIdmaven-plugin-api/artifactId version2.0/version /dependency dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version scopetest/scope /dependency /dependencies build plugins plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-alpha-2/version configuration verbosetrue/verbose components component namehbm2ddl/name implementationjdbcconfiguration/implementation /component component namehbm2hbmxml/name outputDirectorysrc/main/resources/outputDirectory /component /components componentProperties droptrue/drop configurationfile/src/main/resources/hibernate.cfg.xml/configurationfile /componentProperties /configuration dependencies dependency groupIdmysql/groupId artifactIdmysql-connector-java/artifactId version5.0.5/version /dependency /dependencies /plugin /plugins /build /project And I executed the goal: mvn hibernate3:hbm2ddl And it created corresponding table in my database. Cheers! Renu -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 5:49 PM To: 'Maven Users List' Subject: RE: hibernate3 maven2 plugin problem Hello Renu That stills looks that is looking for the JDBC driver. Refer to the bottom of this page: http://mojo.codehaus.org/hibernate3/hibernate3-maven-plugin/usage.html Johann Reyes -Original Message- From: Renu Gupta [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 6:48 AM To: Maven Users List Subject: RE: hibernate3 maven2 plugin problem Hey thanx for ur help.. :) But I m still getting error. :( [DEBUG] Setting context classloader for plugin to: /plugins/org.codehaus.mojo:hibernate3-maven-plugin:[EMAIL PROTECTED]/thread:mai n (instance is: ClassRealm[/plugins/org.codehaus.mojo:hibernate3-maven-plugin:[EMAIL PROTECTED] /thread:main, parent: ClassRealm[plexus.core, parent: null]]) 16:10:24,279 INFO org.hibernate.cfg.Environment - Hibernate 3.2.0.cr5 16:10:24,310 INFO org.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=com.mysql.jdbc.Driver} 16:10:24,310 INFO org.hibernate.cfg.Environment - Bytecode provider name : cglib 16:10:24,342 INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling [DEBUG] basedir: F:\Documents and Settings\rvgupta\eclipsemavenworkspace\trial-plugin 16:10:24,795 INFO org.hibernate.cfg.Configuration - configuring from file: hibernate.cfg.xml [INFO] Configuration XML file loaded: F:\Documents and Settings\rvgupta\eclipsemavenworkspace\trial-plugin\src\main\resources\hiber nate.cfg.xml 16:10:25,201 INFO org.hibernate.cfg.JDBCMetaDataConfiguration - Ignoring null mapping 16:10:25,201 INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null [INFO] src/main/resources/database.properties not found within the project. Trying absolute path. [INFO] No hibernate properties file loaded. 16:10:25,326 INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!) 16:10:25,326 INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20 16:10:25,326 INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false 16:10:25,373 INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/firsthibernate 16:10:25,373 INFO
Re: [m2] can't get hibernate plugin to work with hsql
Hello Mick. First, is this a JPA project or a EJB3 one? Regards Johann Reyes
Re: [m2] can't get hibernate plugin to work with hsql
k. I created a sample project that does what you want to do: http://fisheye.codehaus.org/browse/mojo/trunk/mojo/hibernate3/hibernate3-maven-plugin/src/it/jpa-configuration-hsql Let me know if this helps you or not. Regards Johann Reyes
Re: [m2] can't get hibernate plugin to work with hsql
It looks like its missing the entity-manager dependency, do you have it specified in your pom? Regards Johann Reyes
Re: [m2] can't get hibernate plugin to work with hsql
Hmm, so are you using JPA or EJB? because if it is JPA you need to use jpaconfiguration. Just check that you have the dependencies as seen here: http://fisheye.codehaus.org/browse/mojo/trunk/mojo/hibernate3/hibernate3-maven-plugin/src/it/jpa-configuration-hsql/pom.xml?r=6864 Regards Johann Reyes
[ANN] Maven Hibernate3 Plugin 2.1 Released
The Mojo team is pleased to announce the release of the Maven Hibernate3 Plugin version 2.1. This release contains some dependencies upgrades and bug fixes. A list of changes is attached at the end of this mail. Enjoy! Johann Reyes Release Notes - Maven 2.x Hibernate Plugin - Version 2.1 ** Bug * [MHIBERNATE-67] - Plugin Not Working with a persistence.xml and annotations * [MHIBERNATE-72] - Example page with phase embedding shows wrong example ** Improvement * [MHIBERNATE-64] - Update dependencies to latest hibernate and hibernate tools * [MHIBERNATE-71] - jpaconfiguration does not support namingstrategy
Re: maven, archiva, and hibernate
Hello Benjamin Can you explain a little more, or post example in the differences when you run it offline or not. Regards Johann Reyes
Re: outputDirectory for hibernate3-maven-plugin not working properly
Hello Ikumar Your pom is not well configured. The correct syntax would be: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0/version configuration components component namehbm2java/name outputDirectorysrc/main/java/outputDirectory /component /components /configuration /plugin Regards Johann Reyes
Re: Code Coverage Plugins with Maven 2
Hello Tibi Hmmm that sounds like a bug i saw some time ago, can you try this fix found here and let me know if it works? http://jira.codehaus.org/browse/MCOBERTURA-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_101458 Regards Johann Reyes
Re: Can't compile
Hello Mathias what you need is to remove the runtime scope from your hibernate dependencies. Just delete the scope line. That is telling maven that you don't need those jars to compile your classes, just to run it. For more info about scopes, you can find it here: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html Regards Johann Reyes
Re: hibernate3-maven-plugin not running
Also the phase should be process-classes instead of generate-sources Your java classes need to be compiled first before they can be added to the plugin to create the db schema Regards Johann Reyes
Re: hibernate3-maven-plugin not running
Mathis try this: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-alpha-2/version configuration components component namehbm2ddl/name implementationannotationconfiguration/implementation /component component namehbm2hbmxml/name outputDirectorysrc/main/resources/outputDirectory /component /components componentProperties droptrue/drop createtrue/create configurationfilesrc/main/resources/hibernate.cfg.xml/configurationfile outputfilenameschema.sql/outputfilename /componentProperties /configuration executions execution phasegenerate-sources/phase goals goalhbm2ddl/goal /goals /execution /executions /plugin Regards Johann Reyes
Re: hibernate3-maven-plugin not running
can you run this command and then send the output: mvn -X hibernate3:hbm2ddl Regards Johann Reyes
Re: hibernate3-maven-plugin not running
Also you can run manually the plugin like this: mvn hibernate3:hbm2ddl Regards Johann Reyes
Re: Hibernate and resources
Hello Mathias you should put it in your resources directory and do something like this in your applicationContext.xml in your sessionFactory bean: property name=configLocation value=classpath:hibernate.cfg.xml/ Regards Johann Reyes
[ANN] hibernate3-maven-plugin 1.0-alpha-2
Hello everyone We are pleased to announce the release of the Hibernate3 Maven Plugin version 1.0-alpha-2 * * * This release includes a few significants bits... * Fixed hbmtemplate goal. * Fixed issue with log4j. * Fixed issue with multimodule projects Some other minor bits, like improved support for mojo implementations and a few bugs fixed too. Site is here: http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/ See the change log for the full list of changes: http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=truepid=11215fixfor=13642 Regards Johann Reyes
Re: problems with mvn2, Spring and Hibernate... anyone could help?
Hello Marco I had a problem like that too, overloaded the class to, but didn't like the result of it. At then I came up with the following: * For each project have a hibernate.cfg.xml file that holds reference to your hibernate classes. * in your Sring config file have the following: bean id=sessionFactory class= org.springframework.orm.hibernate3.LocalSessionFactoryBean property name=configLocation value=classpath:hibernate.cfg.xml/ property name=configLocations value=classpath*:hibernate.cfg.xml/ That would work with your local classpath as well with your jars, including test phases Regards Johann Reyes On 7/6/07, Marco Mistroni [EMAIL PROTECTED] wrote: Hi Trevor, thanks... that would work unfortunately my app is splitted in two jars, one for backend and another for webapp. everythign works fine at the junit level for the backend, but once code runs in app server , where the webapp jar is calling the backend jar for interactign with db.. code fails.. my best option now is to override LocalSessionFactoryBean.. i found a sample ont henet, i am going to try and post results.. thanks and regards marco On 7/6/07, Trevor Torrez [EMAIL PROTECTED] wrote: The problem is with the ability of the JVM to enumerate resources in the root of the classpath when these resources are in jars. The mappingJarLocations property would be used to search through jars that are *not* normally on the classpath, so you shouldn't be using that for WEB-INF/lib jars; in some cases you would cause hibernate to read the mapping files twice, once for the jar on the classpath, and once for the jar in the mappingJarLocations -- they just happen to be the same physical jar. The best fix is to create all the hbm.xml files in a subpackage of src/main/resources -- perhaps com/project/domain; then use a resource pattern like classpath*:/com/project/domain/**/*.hbm.xml. On 7/5/07, Marco Mistroni [EMAIL PROTECTED] wrote: Hello Jon actually it has nothing to do with maven, as i discovered later.. since scope=compile will be visible in the test it has to do with Spring classloading actually.. i'll post a solution here as soon as i finish to try some code i found on the web with kindest regards marco On 7/5/07, Jon SlinnHawkins [EMAIL PROTECTED] wrote: I think this may be a problem with Surefire and the way spring uses classloaders : http://jira.codehaus.org/browse/SUREFIRE-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel If you find a solution please post Thanks Marco Mistroni wrote: hi all, i know i should post this to maven list but it is about spring and i am sure someone here is using maven for building its environment I have an app composed of 3 project: - domain OBjects , contains domain objects used by web and backend project - backend project contains hibernate code - webapp contains webwork code that uses hibernate to access database i have been searching for solutions for not hardcoding hibernate mapping files.. i came across mappingJarLocations where you can specify jars where hbm.xml file are located. this is fine, however i am building my project using maven2 and i am setting the dependency scope for domainObjects.jar on my backend project.. if i use scopetest/scope test will fail because spring won't be able to find hbm.xml file (jar is not in classpath) if i use scopecompile/scope jar won't be in test classpath i was wondering if anyone on this forum came across same situation... here's my spring context... bean id=sessionFactory class= org.springframework.orm.hibernate3.LocalSessionFactoryBean property name=dataSource ref bean=dataSource/ /property property name=mappingJarLocations valueclasspath*:domainObjects-1.0-SNAPSHOT.jar /value /property property name=hibernateProperties ref bean=exampleHibernateProperties / /property /bean thanks in advancea nd regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANN] Hibernate3 Maven Plugin 2.0-alpha-1 released
Hello David Actually yes, set the export flag to false Regards Johann Reyes -Original Message- From: David J. M. Karlsen [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 8:21 PM To: Maven Users List Subject: Re: [ANN] Hibernate3 Maven Plugin 2.0-alpha-1 released Johann Reyes skrev: Hello David Thanks for the report, documentation has been fixed. Thanks - I'm using annotations, and call the goals goalhbm2hbmxml/goal goalhbm2cfgxml/goal Is there any way to prevent the plugin from trying to connect to the DB - as the annotations are source for the mapping? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANN] Hibernate3 Maven Plugin 2.0-alpha-1 released
Hello David Thanks for the report, documentation has been fixed. Regards Johann Reyes -Original Message- From: David J. M. Karlsen [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 4:45 PM To: Maven Users List Subject: Re: [ANN] Hibernate3 Maven Plugin 2.0-alpha-1 released Johann Reyes wrote: Hello everyone, I am pleased to announce the release of the Hibernate3 Maven Plugin version 2.0-alpha-1. This release includes: 1) Support of the hbm2doc, hbm2ddl, hbm2java, hbm2hbmxml, and hbm2cfgxml goals from the hibernate-tools project (http://tools.hibernate.org). 2) Plugin documentation. The links on the front-page seem broken, f.ex. http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/hbm2cfgxml .html -- David J. M. Karlsen - +47 90 68 22 43 http://www.davidkarlsen.com http://mp3.davidkarlsen.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin hbm2ddl always try to connect
Hello Miso Sorry for the late reply, and thanks for letting me know, I'll probably add this to the FAQ of the plugin. Thanks again Johann Reyes -Original Message- From: Michal Hlavac [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 21, 2007 11:39 AM To: users@maven.apache.org Cc: Johann Reyes Subject: Re: hibernate3-maven-plugin hbm2ddl always try to connect Dňa Ut 13. Február 2007 Johann Reyes napísal: Still after adding the export flag set to false, still tries to connect? Hello Johann, with componentProperties outputfilenameschema.sql/outputfilename exportfalse/export /componentProperties it works good without connecting to db server. thanks, miso - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Hibernate3 Maven Plugin 2.0-alpha-1 released
Hello everyone, I am pleased to announce the release of the Hibernate3 Maven Plugin version 2.0-alpha-1. This release includes: 1) Support of the hbm2doc, hbm2ddl, hbm2java, hbm2hbmxml, and hbm2cfgxml goals from the hibernate-tools project (http://tools.hibernate.org). 2) Plugin documentation. Feedback and suggestions are welcome. Cheers, Johann Reyes
RE: Hibernate3:hbm2doc
Hello Jim Thanks for the patch, and yeah, if you could send me the info about the hbm2doc, if would be a good example to add to the examples section for the doco. Regards Johann Reyes -Original Message- From: Crossley, Jim [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 10:40 AM To: Maven Users List Subject: RE: Hibernate3:hbm2doc Hi Johann, I patched the plugin to make it work. I'll attach it to MOJO-530. The one currently there won't work with the head revision. I'd like to help you figure out how to integrate the hbm2doc goal into Maven's site generation. Have you considered that? Thanks, Jim -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Thursday, February 22, 2007 1:33 PM To: 'Maven Users List' Subject: RE: Hibernate3:hbm2doc Hello Jim Actually I thought I added support for graphviz but doesn't look like it. I'll be adding the support for that for the next version of the plugin. Right now the plugin is in the process of being voted to be released so I won't be doing any changes until the vote process finishes. Regards Johann Reyes -Original Message- From: Crossley, Jim [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 21, 2007 10:31 AM To: Maven Users List Subject: Hibernate3:hbm2doc Hi. I'm looking to take advantage of hibernate-tools' abililty to generate a graph of my entity relationships. After looking at MOJO-544 and MOJO-530, I thought it might be as easy as applying the attached patch to the source and setting the dotExecutable property, but that didn't work. I notice the hibernate-tools dep version is 3.2-beta9a -- is that newer than beta9? Should the graphviz stuff be in there? Any other ideas how to generate an ER diagram of my EJB3 entities and include it in my site docs? Thanks, Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hibernate3:hbm2doc
Hello Jim Actually I thought I added support for graphviz but doesn't look like it. I'll be adding the support for that for the next version of the plugin. Right now the plugin is in the process of being voted to be released so I won't be doing any changes until the vote process finishes. Regards Johann Reyes -Original Message- From: Crossley, Jim [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 21, 2007 10:31 AM To: Maven Users List Subject: Hibernate3:hbm2doc Hi. I'm looking to take advantage of hibernate-tools' abililty to generate a graph of my entity relationships. After looking at MOJO-544 and MOJO-530, I thought it might be as easy as applying the attached patch to the source and setting the dotExecutable property, but that didn't work. I notice the hibernate-tools dep version is 3.2-beta9a -- is that newer than beta9? Should the graphviz stuff be in there? Any other ideas how to generate an ER diagram of my EJB3 entities and include it in my site docs? Thanks, Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin hbm2ddl always try to connect
Hello Miso Still after adding the export flag set to false, still tries to connect? Regards Johann Reyes -Original Message- From: Michal Hlavac [mailto:[EMAIL PROTECTED] Sent: Sunday, February 11, 2007 10:04 AM To: Maven Users List Subject: Re: hibernate3-maven-plugin hbm2ddl always try to connect Dňa Ne 11. Február 2007 Alejandro Scandroli napísal: Hi Michal Try adding this to your configuration: exportfalse/export I think it will still try to connect to the database (you always need a live connection) but i won't execute the generated statements against the database. hello Alejandro... Why does it need live connection?? thanks, miso - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin hbm2ddl always try to connect
Hello Miso Try this: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration components component namehbm2ddl/name implementationconfiguration/implementation /component /components componentProperties outputfilenameschema.sql/outputfilename /componentProperties /configuration /plugin Regards Johann Reyes -Original Message- From: Michal Hlavac [mailto:[EMAIL PROTECTED] Sent: Friday, February 09, 2007 4:23 AM To: Maven Users List Subject: Re: hibernate3-maven-plugin hbm2ddl always try to connect Dňa St 7. Február 2007 Johann Reyes napísal: Hello Miso From where are you trying to create the schema.sql? from hbm.xml files or annotated classes? from hbm.xml miso - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin hbm2ddl always try to connect
Hello Miso From where are you trying to create the schema.sql? from hbm.xml files or annotated classes? Regards Johann Reyes -Original Message- From: Michal Hlavac [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 11:18 AM To: Maven Users List Subject: hibernate3-maven-plugin hbm2ddl always try to connect hello, I have plugin descriptor: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration componentProperties outputfilenameschema.sql/outputfilename /componentProperties /configuration /plugin but when I call mvn compile hibernate3:hbm2ddl it try to connect to database... But I need only create schema.sql file... thanks, miso - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Maven2+Hibernate3 Annotation Problem
Hello; That's a base example, the plugin configuration should go something like this: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration componentProperties droptrue/drop createtrue/create jdk5true/jdk5 configurationfilesrc/main/resources/hibernate.cfg.xml/configurationfile outputfilenameschema.sql/outputfilename /componentProperties /configuration /plugin Regards Johann Reyes -Original Message- From: lemon dumpling [mailto:[EMAIL PROTECTED] 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 driverjava.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 groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration componentProperties outputfilenameschema.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 groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration components component namehbm2ddl/name /component /components componentProperties droptrue/drop createtrue/create jdk5true/jdk5 configurationfilesrc/main/resources/hibernate.cfg.xml/configurationfile /componentProperties /plugin Cheers On 2/5/07, Johann Reyes [EMAIL PROTECTED] 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:[EMAIL PROTECTED] 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 groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration components component namehbm2ddl/name /component /components componentProperties droptrue/drop createtrue/create configurationfilesrc/main/resources/etc/hibernate.cfg.xml/configurationfi le /componentProperties /configuration /plugin I believe something is missing. Thanks! Cheers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Maven2+Hibernate3 Annotation Problem
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:[EMAIL PROTECTED] 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 groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.0-SNAPSHOT/version configuration components component namehbm2ddl/name /component /components componentProperties droptrue/drop createtrue/create configurationfilesrc/main/resources/etc/hibernate.cfg.xml/configurationfi le /componentProperties /configuration /plugin I believe something is missing. Thanks! Cheers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hibernate3 export where *.hbm.cfg and *.hbm.xml are resources
Hello lexi Are you trying to document your hibernate classes?? Have you tried hbm2doc? Regards Johann Reyes -Original Message- From: Marco Mistroni [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 16, 2007 11:22 AM To: Maven Users List Subject: Re: Hibernate3 export where *.hbm.cfg and *.hbm.xml are resources Hi, i think somehow you can make it work with the genration of DDL if you check pluginDoc, in your configuration element there's something that allows you to use hibernate.properties file (if that is what you are using) alternatively, i think you could still invoke schemaExport (or whatever task is called in hibernate3) from maven-antrun-plugin hth marco On 1/16/07, Aleksei Valikov [EMAIL PROTECTED] wrote: Hi. i think you can configure what todo in the sessionFactory prop key=hibernate.hbm2ddl.autocreate/prop that way will be easier Yes, this is how it works right now. But we'd also like to generate the DDLs for documentation/reference purposes. with codehaus plugin you can use also an hibernate.properties, pls check properties available for that plugin when i tried, i didnt succeeded, so i decided to configure it on the sessionFactory. for tests, i am using a different DS, with different properties Ok, nice idea, thanks! Bye. /lexi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hibernate3 export where *.hbm.cfg and *.hbm.xml are resources
Hello lexi K, so you need to use hbm2ddl with the jdbcconfiguration implementation with the component property outputfilename set to a sql filename. Regards Johann Reyes -Original Message- From: Aleksei Valikov [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 23, 2007 12:45 PM To: Maven Users List Subject: Re: Hibernate3 export where *.hbm.cfg and *.hbm.xml are resources Hi. Are you trying to document your hibernate classes?? Have you tried hbm2doc? No, we really need the database schema (DDL) for project documentation. Bye. /lexi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using hibernate3-maven-plugin:hmb2ddl with test-classes
Hello Andi Well you just found a bug. I fixed already in SVN and deployed a new snapshot. Try it out and let me know how it works Regards Johann Reyes -Original Message- From: garbandi [mailto:[EMAIL PROTECTED] Sent: Friday, January 05, 2007 8:02 AM To: users@maven.apache.org Subject: RE: using hibernate3-maven-plugin:hmb2ddl with test-classes hi johann, thanks for your help. adding the flag to the properties leads to various lines of output [INFO] found EJB3 Entity bean: XXX where XXX now contains the classes in the test-classes directory but then i receive a new ClassNotFoundException for those classes: Caused by: java.lang.ClassNotFoundException: XXX at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.j ava:195) at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java: 255) at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java: 274) at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java: 274) at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:21 4) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112) at org.codehaus.mojo.hibernate3.configuration.AnnotationComponentConfiguration. classForName(AnnotationComponentConfiguration.java:204) at org.codehaus.mojo.hibernate3.configuration.AnnotationComponentConfiguration. addNamedAnnotatedClasses(AnnotationComponentConfiguration.java:175) ... 22 more when i move the testclasses back to the src-area everything works. seems that the classloader doesn't contain the test-classes, although you find them. any idea? regards, andi Johann Reyes-2 wrote: Hello Andi Sorry, but I haven't document yet that part of the plugin because it's being tested. To scan the test-classes directory you need to add the following flag to your componentProperties element: componentProperties scan-classestrue/scan-classes /componentProperties Let me know if you have any question Regards Johann Reyes -- View this message in context: http://www.nabble.com/using-hibernate3-maven-plugin%3Ahmb2ddl-with-test-clas ses-tf2912961s177.html#a8177566 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using hibernate3-maven-plugin:hmb2ddl with test-classes
Hello Andi I believe that with version 1.0-SNAPSHOT you can not scan the test-classes, but 2.0-SNAPSHOT can do. Would you be willing to use the 2.0-SNAPSHOT? I can help you to configure again your plugin if that is the case. Regards Johann Reyes -Original Message- From: garbandi [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 03, 2007 6:35 AM To: users@maven.apache.org Subject: using hibernate3-maven-plugin:hmb2ddl with test-classes hi, how can i set up hibernate3-maven-plugin (i'm using snapshot 1.0) to let hmb2ddl scan classes from target/test-classes for annotations? some backgroundinfo: i'm trying to set up a jar-project that uses hibernate-annotations. it contains base-classes that use the @MappedSuperclass. i want to write some unittest for this project that contain the @Entity-classes. But if i use the hbm2ddl-goal it won't scan for annotations that are part of the src/test-area. so is there a way to add target/test-classes into the classpath that hbm2ddl scans? thanks in advance, andi -- View this message in context: http://www.nabble.com/using-hibernate3-maven-plugin%3Ahmb2ddl-with-test-clas ses-tf2912961s177.html#a8139189 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using hibernate3-maven-plugin:hmb2ddl with test-classes
Hello Andi Sorry, but I haven't document yet that part of the plugin because it's being tested. To scan the test-classes directory you need to add the following flag to your componentProperties element: componentProperties scan-classestrue/scan-classes /componentProperties Let me know if you have any question Regards Johann Reyes -Original Message- From: garbandi [mailto:[EMAIL PROTECTED] Sent: Thursday, January 04, 2007 11:53 AM To: users@maven.apache.org Subject: RE: using hibernate3-maven-plugin:hmb2ddl with test-classes hi johann, i've moved to 2.0. but i didn't find myself a way to scan the classes in test-classes. so i would appreciate your help. best regards, andi Johann Reyes-2 wrote: Hello Andi I believe that with version 1.0-SNAPSHOT you can not scan the test-classes, but 2.0-SNAPSHOT can do. Would you be willing to use the 2.0-SNAPSHOT? I can help you to configure again your plugin if that is the case. Regards Johann Reyes -- View this message in context: http://www.nabble.com/using-hibernate3-maven-plugin%3Ahmb2ddl-with-test-clas ses-tf2912961s177.html#a8162664 Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do i use the hibernate3 plugin from codehause
Hello Charles To output to a file, you just need to check that you have configured the following parameter outputFile as described here: http://mojo.codehaus.org/hibernate3-maven-plugin/hbm2ddl-mojo.html Once the plugin sees that you have specified that parameter, it won't attempt to write in the database, instead it would do it in the file just specified. *note* Just specify a filename like dll-schema.sql not a file path. Regards Johann Reyes -Original Message- From: Charles Harvey III [mailto:[EMAIL PROTECTED] Sent: Friday, October 20, 2006 10:01 AM To: Maven Users List Subject: Re: How do i use the hibernate3 plugin from codehause You have been able to generate DDL files? See, I think I was mislead by what hibernate3:hbm2ddl is supposed to do. I wanted it to generate a bunch of text files with a bunch of CREATE statements. Instead, it connects to my database and creates the tables for me. I can't stop it from doing that. If I don't put in a connection URL to the database, it fails. And I have setup the outputDirectory correctly in the plugin setup, still nothing. Can someone send me their exact setup so that I can try this again. And, just to be sure. Is this possible? I do NOT want to have the tables created automatically. I just want text files. Thanks. Charlie Stefan Hübner said the following on 10/19/2006 1:34 PM: Hi Yves, 2006/10/19, Yves Van Steen [EMAIL PROTECTED]: I want to create ddl sql files from my hbm files but none of the goals of the hibernate3 plugin actually works? Is this plugin useable or still in development? I'm using it quite successfully to generate ddl-files with hibernate3:hbm2ddl. I was also trying to get hbm2doc running, but that one is not working as of now, because the Hibernate-libraries are not stable yet. Apperently there are some screwed up dependencies. It's in development (1.0-SNAPSHOT). There was an attempt to publish 1.0, but that process got stuck a while ago. there are still some bugs left - like your one. you might want to keep track of http://jira.codehaus.org/browse/MOJO-515. I think, whenever the Hibernate guys publish their 3.2 release, this plugin will be fixed. Even now it does a great job. jm2c -Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:4538d73c241851913645530! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do i use the hibernate3 plugin from codehause
Hello Yves To create sql from hbm.xml files it works, from the error message that you posted, it looks like it's failing to connect to your database server as it looks it's trying to create the database tables in it. The difference between hbm2ddl and schema-export is that hbm2ddl is used to create and update database schemas (thus you need to specify what action you are going to do in your pom.xml) while the schema-export you don't need to specify nothing in your pom.xml and it creates the tables in the database while schema-update it just update the schema in the database. About your error, it looks the database it's running because the database it's refusing the connection, so I would check the username and password that you are using to create the connection to see if they are the right ones. Regards Johann Reyes -Original Message- From: Yves Van Steen [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 1:01 PM To: Maven Users List Subject: How do i use the hibernate3 plugin from codehause Hey, I want to create ddl sql files from my hbm files but none of the goals of the hibernate3 plugin actually works? Is this plugin useable or still in development? If possible I also want to execute these sql files to my database server. Anybody have any ideas? My configuration is the same as on the info site HYPERLINK http://mojo.codehaus.org/hibernate3-maven-plugin/howto.htmlhttp://mojo.cod ehaus.org/hibernate3-maven-plugin/howto.html OUTPUT Hibernate3:hbm2java = generates the java files but ends with an error hibernate3:schema-update = returns success but does nothing hibernate3:hbm2doc = class not found exception org/hibernate/engine/query/sql/NativeSQLQueryReturn hibernate3:hbm2hbmxml = class not found exception org/hibernate/engine/query/sql/NativeSQLQueryReturn Hibernate3:hbm2ddl hibernate3:schema-export (any difference between the 2 ???) returns this [INFO] Configuration XML file loaded: G:\PROJECTS\sw - admin baert\source\Common \src\main\resources\hibernate.cfg.xml [INFO] Configuration Properties file loaded: G:\PROJECTS\sw - admin baert\source \Common\src\main\resources\database.properties [WARNING] 1 error(s) occurred while performing hbm2ddl. [WARNING] Error #1: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused: connect STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja va:156) at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:276) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2641) at com.mysql.jdbc.Connection.init(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :266) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.hibernate.connection.DriverManagerConnectionProvider.getConnectio n(DriverManagerConnectionProvider.java:110) at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(Ma nagedProviderConnectionHelper.java:28) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:178 ) at org.codehaus.mojo.hibernate3.exporter.SchemaExportMojo.doSchemaExport (SchemaExportMojo.java:79) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(H bm2DDLExporterMojo.java:56) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE xporterMojo.java:59) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39
RE: How do i use the hibernate3 plugin from codehause
Hello Charles From hbm.xml files it works sql generation. From annotated classes also it does. For JPA classes not sure yet as they are something new and I'm looking into it. I have checked my messages and haven't found a message from you reporting a problem, so if you like I can help you with it. Regards Johann Reyes -Original Message- From: Charles Harvey III [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 1:04 PM To: Maven Users List Subject: Re: How do i use the hibernate3 plugin from codehause No. It does not work. I have been trying to get that thing to generate SQL files for a month now. Don't bother wasting your time. Charlie Yves Van Steen said the following on 10/19/2006 1:00 PM: Hey, I want to create ddl sql files from my hbm files but none of the goals of the hibernate3 plugin actually works? Is this plugin useable or still in development? If possible I also want to execute these sql files to my database server. Anybody have any ideas? My configuration is the same as on the info site HYPERLINK http://mojo.codehaus.org/hibernate3-maven-plugin/howto.htmlhttp://mo jo.cod ehaus.org/hibernate3-maven-plugin/howto.html OUTPUT Hibernate3:hbm2java = generates the java files but ends with an error hibernate3:schema-update = returns success but does nothing hibernate3:hbm2doc = class not found exception org/hibernate/engine/query/sql/NativeSQLQueryReturn hibernate3:hbm2hbmxml = class not found exception org/hibernate/engine/query/sql/NativeSQLQueryReturn Hibernate3:hbm2ddl hibernate3:schema-export (any difference between the 2 ???) returns this [INFO] Configuration XML file loaded: G:\PROJECTS\sw - admin baert\source\Common \src\main\resources\hibernate.cfg.xml [INFO] Configuration Properties file loaded: G:\PROJECTS\sw - admin baert\source \Common\src\main\resources\database.properties [WARNING] 1 error(s) occurred while performing hbm2ddl. [WARNING] Error #1: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused: connect STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused: connect at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja va:156) at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:276) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2641) at com.mysql.jdbc.Connection.init(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :266) at java.sql.DriverManager.getConnection(DriverManager.java:525) at java.sql.DriverManager.getConnection(DriverManager.java:140) at org.hibernate.connection.DriverManagerConnectionProvider.getConnectio n(DriverManagerConnectionProvider.java:110) at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(Ma nagedProviderConnectionHelper.java:28) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:178 ) at org.codehaus.mojo.hibernate3.exporter.SchemaExportMojo.doSchemaExport (SchemaExportMojo.java:79) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(H bm2DDLExporterMojo.java:56) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE xporterMojo.java:59) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585
RE: [m2] Frustration getting Maven 2 and Hibernate working together
Hello Matt The dependencies issue its fixed in the hibernate tools dependency that's in queue to be uploaded (http://jira.codehaus.org/browse/MAVENUPLOAD-1053). These dependencies would depend on jars that are in the maven repo like the Geronimo's JTA implementation. So as soon these dependencies are uploaded, I'll publish a new snapshot of the plugin. Regards Johann Reyes -Original Message- From: mraible [mailto:[EMAIL PROTECTED] Sent: Thursday, August 24, 2006 5:14 PM To: users@maven.apache.org Subject: Re: [m2] Frustration getting Maven 2 and Hibernate working together Paul Kuykendall wrote: Jose, I found this in a blog somewhere (I didn't bookmark it, just copied it into a tips and tricks email I sent myself at work). I still ran into problems with the hibernate3-maven-plugin complaining it couldn't resolve a dependency somewhere down the line to maven-hibernate3-plugin. It could have been something I've been doing wrong, but your problem was fairly easy to track down (after more than a few hours of google searching). I did use a different way of doing the jta installation. I created a jar file and installed that rather than the zip file. /Paul The below is quite shamefully included without attribution. I take no claim for its origination. Special dependencies Most of the dependencies you need will be automatically downloaded by Maven from a remote repository, but two by Sun can't be held there. Go to this page http://java.sun.com/products/jta/ to get the JTA interfaces from the Download link next to Class Files 1.0.1B, then paste the following into a shell in your download directory: mvn install:install-file -DgroupId=javax.transaction \ -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar \ -Dfile=jta-1_0_1B-classes.zip (Or use jta.jar from the Hibernate 3.1.1 distribution, if you have that already — just change the -Dfile= parameter above.) For the EJB 3.0 *public final draft* dependency, you'll need to download Hibernate Annotationshttp://prdownloads.sourceforge.net/hibernate/hibernate-ann otations-3.2.0.CR1.tar.gz?download, expand the archive, change to its lib directory, then: mvn install:install-file -DgroupId=javax.persistence \ -DartifactId=ejb -Dversion=3.0-public-draft-20060502 \ -Dpackaging=jar -Dfile=ejb3-persistence.jar Is it possible to override a plugin's dependencies, like you can with a normal dependency? I'm trying to use the maven-hibernate3-plugin, and getting the following error: Missing: -- 1) javax.transaction:jta:jar:1.0.1B Try downloading the file manually from: http://java.sun.com/products/jta Then, install it using the command: mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta \ -Dversion=1.0.1B -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) org.codehaus.mojo:hibernate3-maven-plugin:maven-plugin:1.0-20060418.000301-9 2) org.hibernate:hibernate-tools:jar:3.1.0.beta4 3) org.hibernate:hibernate:jar:3.1.2 4) javax.transaction:jta:jar:1.0.1B -- 1 required artifact is missing. for artifact: org.codehaus.mojo:hibernate3-maven-plugin:maven-plugin:1.0-20060418.000301-9 I'd like to do something like I can do in my normal pom.xml's - where I can use Geronimo's JTA implementation instead: dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.0.cr3/version exclusions exclusion groupIdjavax.transaction/groupId artifactIdjta/artifactId /exclusion /exclusions /dependency dependency groupIdgeronimo-spec/groupId artifactIdgeronimo-spec-jta/artifactId version1.0.1B-rc4/version /dependency Thanks, Matt -- View this message in context: http://www.nabble.com/-m2--Frustration-getting-Maven-2-and-Hibernate-working-together-tf1892454.html#a5972898 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin: hbm2hbmxml does not generate any hbm.xml files
Kaj Question, do you have annotated classes? Regards Johann Reyes -Original Message- From: Kaj Hejer [mailto:[EMAIL PROTECTED] Sent: Thursday, August 24, 2006 4:58 AM To: users@maven.apache.org Subject: hibernate3-maven-plugin: hbm2hbmxml does not generate any hbm.xml files Hi! I'm trying to generate hbm.xml files running mvn hibernate3:hbm2hbmxml, but no hbm.xml files are generated. Do I need in some way to tell the plugin which tables to generate mappingsfiles for, other than specifying the jdbc url, username and password for the database in hibernate.cfg.xml? Here is the output I get: $mvn hibernate3:hbm2hbmxml [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'hibernate3'. [INFO] [INFO] Building Xs [INFO]task-segment: [hibernate3:hbm2hbmxml] [INFO] [INFO] Preparing hibernate3:hbm2hbmxml [INFO] No goals needed for project - skipping [INFO] [hibernate3:hbm2hbmxml] [INFO] No output directory found for hbm2hbmxml, using the default: target/hibernate3/generated-mappings INFO 24.08 09:42:57 (Environment.java:479) - Hibernate 3.1.2 INFO 24.08 09:42:57 (Environment.java:509) - hibernate.properties not found INFO 24.08 09:42:57 (Environment.java:525) - using CGLIB reflection optimizer INFO 24.08 09:42:57 (Environment.java:555) - using JDK 1.4 java.sql.Timestamp handling INFO 24.08 09:42:57 (Configuration.java:1342) - configuring from file: hibernate.cfg.xml DEBUG 24.08 09:42:57 (DTDEntityResolver.java:42) - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/ DEBUG 24.08 09:42:57 (DTDEntityResolver.java:56) - found http:// hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.connection.password=xxx DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.connection.url= DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.connection.username= DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.dialect=org.hibernate.dialect.Oracle9Dialect DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.show_sql=true DEBUG 24.08 09:42:57 (Configuration.java:1269) - hibernate.use_sql_comments=true INFO 24.08 09:42:57 (Configuration.java:1419) - Configured SessionFactory: null DEBUG 24.08 09:42:57 (Configuration.java:1420) - properties: {hibernate.connection.password=xxx, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=/System/ Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries, java.vm.version=1.5.0_06-64, awt.nativeDoubleBuffering=true, hibernate.connection.username=, gopherProxySet=false, java.vm.vendor=Apple Computer, Inc., java.vendor.url=http:// apple.com/, path.separator=:, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, user.dir=xxxtrunk, java.runtime.version=1.5.0_06-112, java.awt.graphicsenv=apple.awt.CGraphicsEnvironment, java.endorsed.dirs=/System/Library/Frameworks/JavaVM.framework/ Versions/1.5.0/Home/lib/endorsed, os.arch=i386, java.io.tmpdir=/tmp, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., os.name=Mac OS X, classworlds.conf=/usr/local/maven2/bin/m2.conf, sun.jnu.encoding=MacRoman, java.library.path=.:/Library/Java/ Extensions:/System/Library/Java/Extensions:/usr/lib/java, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=10.4.7, user.home=/Users/kajh, user.timezone=Europe/Oslo, java.awt.printerjob=apple.awt.CPrinterJob, file.encoding=MacRoman, java.specification.version=1.5, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, java.class.path=/usr/local/maven2/core/boot/classworlds-1.1.jar:/ System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/ Classes/.compatibility/14compatibility.jar, user.name=kajh, hibernate.use_sql_comments=true, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=/System/Library/ Frameworks/JavaVM.framework/Versions/1.5.0/Home, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.connection.url=, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=apple.awt.CToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, sharing, java.version=1.5.0_06, java.ext.dirs=/Library/Java/ Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/ JavaVM.framework/Versions/1.5.0/Home/lib/ext, sun.boot.class.path=/ System/Library/Frameworks/JavaVM.framework/Versions
RE: hibernate3-maven-plugin:hbm2doc: IndexOutOfBoundsException
Hello Kaj This might be a problem with the dependencies. I'm updating the dependencies so I'll keep let you know once I have done this for you to try it again. Regards Johann reyes -Original Message- From: Kaj Hejer [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 22, 2006 8:15 AM To: users@maven.apache.org Subject: hibernate3-maven-plugin:hbm2doc: IndexOutOfBoundsException Hi! When running mvn hibernate3:hbm2doc when using hibernate3-maven-plugin I get the following stacktrace: DEBUG 22.08 11:13:15 (TemplateHelper.java:220) - putInContext docFile=index.html INFO 22.08 11:13:15 (VelocityProducer.java:46) - Writing doc/entities/ index.vm to /Users/kajh/src/w3/webapps/nettskjema/trunk/target/ hibernate3/javadoc/entities/index.html DEBUG 22.08 11:13:15 (TemplateHelper.java:227) - removeFromContext docFile=index.html [INFO] [ERROR] FATAL ERROR [INFO] [INFO] Index: 0, Size: 0 [INFO] [INFO] Trace java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.RangeCheck(ArrayList.java:546) at java.util.ArrayList.remove(ArrayList.java:389) at org.hibernate.tool.hbm2x.DocExporter.generatePackageSummary (DocExporter.java:251) at org.hibernate.tool.hbm2x.DocExporter.doStart (DocExporter.java:154) at org.hibernate.tool.hbm2x.AbstractExporter.start (AbstractExporter.java:92) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.doExecute (HibernateExporterMojo.java:96) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute (HibernateExporterMojo.java:60) at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa l(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle Failures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java: 322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced (Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode (Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] [INFO] Total time: 7 seconds [INFO] Finished at: Tue Aug 22 11:13:15 CEST 2006 [INFO] Final Memory: 6M/12M [INFO] I'm using java5 on osx 10.4.7. Any ideas? -Kaj :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate hbm.xml file not found
Hello Lakshman I think I answered this before in the following post: http://www.mail-archive.com/users@maven.apache.org/msg49367.html Regards Johann Reyes -Original Message- From: Lakshman Srilakshmanan [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 15, 2006 3:48 AM To: Maven Users List Subject: hibernate hbm.xml file not found Hi All, When I try to generate-sources for hibernate java files from xxx.hbm.xml from within maven using goalhbm2java/goal nothing is created. But, if I get (by hook or by crook) the xxx.hbm.xml file into target/classes then I am able to generate the java files. I believe this is because hibernate tool looks in hibernate classpath for the xxx.hbm.xml files. How do I include src/main/resources into the hibernate classpath or do I have to create an ant task to copy the xxx.hbm.xml file into target/classes in the generate-sources phase before executing hbm2java. Is there an alternate way or is this a bug ?? Could someone please point me in the right direction. Thanks Lakshman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hibernate plugin not binding?
Hello Lakshman Sorry for not answering before, was out of town. Well I found some issues with the dependencies of the plugin that I'm going as soon as I get some free time. But basically the idea behind hbm2java goal is that it would look for *.hbm.xml files in the classpath (target/classes) and then go ahead to create the java files. So to begin with you have to take into account that the plugin was created more as a command plugin than a lifecycle one so the command to run hbm2java without modifying the lifecycles or having executions and assuming your *.hbm.xml files are under your /src/java/resources directory would be: mvn clean resources:resources hibernate3:hbm2java [clean] delete target directory [resources:resources] copy my *.hbm.xml files to my target directory [hibernate3:hbm2java] and now the hibernate plugin knows where to find your hibernate mapping files so go ahead and create the java source files Hope that helps, please let me know if you need any other help. Regards Johann Reyes -Original Message- From: Lakshman Srilakshmanan [mailto:[EMAIL PROTECTED] Sent: Monday, August 14, 2006 9:37 PM To: Cristian Jansenson Cc: Maven Users List Subject: RE: Hibernate plugin not binding? Hi Cristian Thanks for providing me with your feedback. I did finally solve this problem by downloading and compiling it locally. http://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/maven-hibernate3/hi bernate3-maven-plugin/ my pom.xml is setup as follows dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version scopetest/scope /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.1.2/version /dependency dependency groupIdhsqldb/groupId artifactIdhsqldb/artifactId version1.8.0.4/version /dependency /dependencies build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version1.0-SNAPSHOT/version executions execution idgenerate-hibernate/id phasegenerate-sources/phase configuration hibernate configurationFile/src/main/resources/hibernate.cfg.xml/configurationF ile /hibernate outputDirectory hbm2cfgxmlsrc/main/resources/hbm2cfgxml hbm2javatarget/hibernate3/generated-sources/hbm2java /outputDirectory /configuration goals goalhbm2java/goal /goals /execution /executions /plugin /plugins extensions extension groupIdhsqldb/groupId artifactIdhsqldb/artifactId version1.8.0.4/version /extension /extensions /build Hope it helps :) Thanks Lakshman -Original Message- From: Cristian Jansenson [mailto:[EMAIL PROTECTED] Sent: Tuesday, 15 August 2006 11:07 AM To: Lakshman Srilakshmanan Subject: RE: Hibernate plugin not binding? No problem... and I didn't resolve this problem. My understanding on this issue is that, as of the date I reported it, it was not resolved. Furthermore, some people informally solved the problem by modifying the plugin; However, they didn't submit the fix because it was a hack more than a real fix. I suspect this issue will be addressed with the official version of the pluggin. Cristian -Original Message- From: Lakshman Srilakshmanan [mailto:[EMAIL PROTECTED] Sent: Sunday, August 13, 2006 8:10 PM To: [EMAIL PROTECTED] Subject: Hibernate plugin not binding? Hi Cristian Sorry for contacting you directly, but did you resolve the above issue I have included a link to the above problem you raised for your convenience. http://www.mail-archive.com/users@maven.apache.org/msg41711.html Your assistance is greatly appreciated. Thanks Lakshman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best practices in testing Hibernate/EJB3 POJOs (or doing database tests)
Hello Jose About problem 1: You can use HSQL About problem 2: You can run the tests against HSQL, so you can the connection properties inside your test directory, so those tests would just run against your embeddable database. An example can be found here: http://fisheye.codehaus.org/browse/mojo/trunk/mojo/mojo-sandbox/hibernate3-m aven-plugin/src/test/project-jdk15/src/main/resources/database.properties?r= 1673 Regards Johann Reyes -Original Message- From: Jose Gonzalez Gomez [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 11, 2006 7:53 AM To: Maven Users List Subject: Best practices in testing Hibernate/EJB3 POJOs (or doing database tests) Hi there, I would like to hear about what you're doing to test your Hibernate/EJB3 POJOs (if you're doing at all). I have a project with some of them, and I have the following concerns: First of all, I may test them just ignoring persistence (already done). No problem here, just a bunch of TestNG tests running smoothly under Maven2. I think this is important, as I'm developing a library mainly intended to be used as annotated Hibernated POJOs, but maybe people using it prefer another persistence api. What do you think? Then I thought about testing the library including the persistence stuff, but this brings some problems: Problem 1: Whenver building the project, publishing the site, etc. you must have access to a runnning database in order to perform the tests. I'm currently running a postgresql database, but it may be cumbersome for users wanting to download and hack the sources. Maybe this could be solved using some kind of embeddable database? Or maybe I could create several profiles (never done this) and activate database tests only under demand? Problem 2: Having database tests involves having configuration data written down in some configuration file (the jdbc URL, user, password, etc. hibernate.cfg.xml) or even in the pom (jdbc driver dependency). It's kind of putting in the sources of the library some information that may be only of interest to me in my current environment. How to solve this? Again using some kind of embeddable datasource for tests? Using source filters? (again, I haven't done this before, so I don't know if it's suitable) Best regards Jose - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [m2] Frustration getting Maven 2 and Hibernate working together
Hello Jose Actually, I'm not, I should be, but I wasn't subscribe in that list, if you want to resend your email, I'll be able to receive it now. Regards Johann Reyes -Original Message- From: Jose Gonzalez Gomez [mailto:[EMAIL PROTECTED] Sent: Friday, July 07, 2006 3:20 AM To: Maven Users List Subject: Re: [m2] Frustration getting Maven 2 and Hibernate working together Glad to help :o) About the hibernate dependency, I just have added the hibernate annotations jar because I'm using some hibernate propietary annotations. By the way, are you subscribed to the mojo user list? I sent a message there about an issue regarding schema usage, but no one has answered... should I forward the question to the mojo development list? Best regards Jose 2006/7/6, Johann Reyes [EMAIL PROTECTED]: Hello Jose Thanks for the help; I updated the documentation to reflect this. Also to use the plugin you don't need to include the hibernate jars as dependency to run the plugin. Regards Johann Reyes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hibernate 3 failure
Hello Richards This is strange, would be possible for you to send your pom.xml file to check it out. Regards Johann Reyes -Original Message- From: James Richards [mailto:[EMAIL PROTECTED] Sent: Friday, July 07, 2006 11:17 AM To: users@maven.apache.org Subject: Hibernate 3 failure Hello, I've tried searching for this problem on Google but so far have not had any luck locating this exact error so I wanted to see if anyone on the mailing can help out. I have Maven 2.0.4 installed and I am trying to use the Hibernate3 plugin. I added the repositories configuration to my pom.xml: repositories repository idMaven Snapshots/id urlhttp://snapshots.maven.codehaus.org/maven2//url snapshots enabledtrue/enabled /snapshots releases enabledfalse/enabled /releases /repository /repositories pluginRepositories pluginRepository idMaven Snapshots/id urlhttp://snapshots.maven.codehaus.org/maven2//url snapshots enabledtrue/enabled /snapshots releases enabledfalse/enabled /releases /pluginRepository /pluginRepositories and was able to download the required plugin but it fails with the following error: [INFO] [hibernate3:hbm2ddl] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null org/apache/log4j/Category [INFO] [INFO] Trace java.lang.ExceptionInInitializerError at org.codehaus.mojo.hibernate3.exporter.SchemaExportMojo.doSchemaExport(Schema ExportMojo.java:63) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLE xporterMojo.java:55) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporter Mojo.java:60) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1afae45 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1afae45 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja va:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja va:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja va:209) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) at org.hibernate.tool.hbm2ddl.SchemaExport.clinit(SchemaExport.java:47) ... 21 more Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1afae45 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryI mpl.java:413) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja va
RE: Hibernate 3 failure
Hello James Yes, the extension is necessary as this is the only way for the moment that I found to pass the JDBC driver to the plugin layer. Please try it and let me know how it went. Regards Johann Reyes -Original Message- From: James Richards [mailto:[EMAIL PROTECTED] Sent: Friday, July 07, 2006 11:37 AM To: Maven Users List Subject: RE: Hibernate 3 failure I have the exact same plugin configuration but I do not have any extensions enabled: extensions extension groupIdjdbc.artifact.groupid/groupId artifactIdjdbc-driver/artifactId version1.0/version /extension /extensions I am actually using the sun JDBC-ODBC bridge driver for this application [for legacy reasons] so is that particular extensions configuration required? Thanks, James -Original Message- From: [EMAIL PROTECTED] on behalf of ben short Sent: Fri 7/7/2006 11:28 AM To: Maven Users List Subject: Re: Hibernate 3 failure Have you seen this page? http://mojo.codehaus.org/hibernate3-maven-plugin/howto.html Ben On 7/7/06, James Richards [EMAIL PROTECTED] wrote: Hello, I've tried searching for this problem on Google but so far have not had any luck locating this exact error so I wanted to see if anyone on the mailing can help out. I have Maven 2.0.4 installed and I am trying to use the Hibernate3 plugin. I added the repositories configuration to my pom.xml: repositories repository idMaven Snapshots/id urlhttp://snapshots.maven.codehaus.org/maven2//url snapshots enabledtrue/enabled /snapshots releases enabledfalse/enabled /releases /repository /repositories pluginRepositories pluginRepository idMaven Snapshots/id urlhttp://snapshots.maven.codehaus.org/maven2//url snapshots enabledtrue/enabled /snapshots releases enabledfalse/enabled /releases /pluginRepository /pluginRepositories and was able to download the required plugin but it fails with the following error: [INFO] [hibernate3:hbm2ddl] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] null org/apache/log4j/Category [INFO] [INFO] Trace java.lang.ExceptionInInitializerError at org.codehaus.mojo.hibernate3.exporter.SchemaExportMojo.doSchemaExport(Schema ExportMojo.java:63) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLE xporterMojo.java:55) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporter Mojo.java:60) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1afae45 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@1afae45 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category
RE: [m2] Frustration getting Maven 2 and Hibernate working together
Hello Jose Thanks for the help; I updated the documentation to reflect this. Also to use the plugin you don't need to include the hibernate jars as dependency to run the plugin. Regards Johann Reyes -Original Message- From: Jose Gonzalez Gomez [mailto:[EMAIL PROTECTED] Sent: Thursday, July 06, 2006 3:18 AM To: Maven Users List Subject: Fwd: [m2] Frustration getting Maven 2 and Hibernate working together Just in case anybody else needs it... -- Forwarded message -- From: Jose Gonzalez Gomez [EMAIL PROTECTED] Date: 06-jul-2006 8:40 Subject: Re: [m2] Frustration getting Maven 2 and Hibernate working together To: Paul Kuykendall [EMAIL PROTECTED] Ok, here we go... First of all, add this to settings.xml (in your .m2 directory) in order to be able to download plugins from the mojo repository: settings !-- Proxy, servers, whatever you have here -- !-- Access to mojo.codehaus.org plugins -- profiles profile idSnapshots/id pluginRepositories pluginRepository idMaven Snapshots/id urlhttp://snapshots.maven.codehaus.org/maven2//url snapshots enabledtrue/enabled /snapshots releases enabledfalse/enabled /releases /pluginRepository /pluginRepositories /profile /profiles activeProfiles activeProfileSnapshots/activeProfile /activeProfiles /settings Now, declare some dependencies in your pom, including the plugin configuration and your desired JDBC driver (PostgreSQL in this case): ?xml version=1.0 encoding=UTF-8? [...] build plugins plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version1.0-SNAPSHOT/version configuration hibernate configurationFile/src/main/resources/hibernate.cfg.xml/configurationFile /hibernate outputDirectory hbm2cfgxmlsrc/main/resources/hbm2cfgxml /outputDirectory /configuration /plugin /plugins extensions extension groupIdpostgresql/groupId artifactIdpostgresql/artifactId version8.1-407.jdbc3 /version /extension /extensions /build !-- === HIBERNATE PLUGIN === -- dependencies [...] dependency groupIdjavax.persistence/groupId artifactIdpersistence-api/artifactId /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version3.2.0.cr1/version exclusions exclusion groupIdjavax.persistence /groupId artifactIdejb/artifactId /exclusion /exclusions /dependency /dependencies /project Comments on this: first of all, I have no version declared for persistence-api because I have a parent pom with dependency management (I will include hibernate-annotations there once I have an stable configuration); you must include hibernate-annotations as a dependency in your project only if you want to use hibernate propietary annotations; if you do include hibernate-annotations you must exclude the javax.persistence:ejb dependency, as it uses and old draft version I've been unable to find on the Internet. Finally you must create your /src/main/resources/hibernate.cfg.xml, something like this: ?xml version=' 1.0' encoding='utf-8'? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration !-- a SessionFactory instance listed as /jndi/name -- session-factory name=java:hibernate/SessionFactory !-- properties -- property name=connection.driver_classorg.postgresql.Driver /property property name=connection.urljdbc:postgresql://your.server/yourDatabase/property property name=connection.usernameyourUser/property property name=connection.passwordyourPassword/property property name=dialect org.hibernate.dialect.PostgreSQLDialect /property property name=show_sqlfalse/property property name=transaction.factory_class org.hibernate.transaction.JTATransactionFactory /property property name=jta.UserTransaction java:comp/UserTransaction/property !-- mapping files -- !-- mapping package=org.surveyforge.classification / -- mapping class=org.surveyforge.classification.Family / /session-factory /hibernate-configuration I was testing a single class, I guess if you have a full package you may use the commented line to include all the classes. Once I did this, I run mvn hibernate3:hbm2ddl and the plugin connected to my database and created the table. I think I don't miss anything... HTH, best regards Jose 2006/7/5, Paul Kuykendall [EMAIL PROTECTED]: I would be more appreciative than you can ever imagine if you could send that information. Thanks! /Paul
RE: Regenerate hibernate mapping files
Hello Jeff Actually you are using Xdoclet to generate your hibernate mapping files. The hibernate3-maven-plugin is not based on Xdoclet; it's based on hibernate-tools which you can find more info here: http://tools.hibernate.org/ Regards Johann Reyes -Original Message- From: Jeff Mutonho [mailto:[EMAIL PROTECTED] Sent: Thursday, July 06, 2006 9:52 AM To: Maven Users List Subject: Regenerate hibernate mapping files I wish to regenerate hibernate(version 2.0) mapping files in my project and currently am using Ant to do so.Can I achieve the same with the hibernate3-maven-plugin ? Here's the ant task : !-- regenerate the hibernate mapping files -- taskdef name=hibernatedoclet classname=xdoclet.modules.hibernate.HibernateDocletTask classpath refid=portallib.classpath / /taskdef hibernatedoclet destdir=${ant.common.eportal.services.dir}/src force=false excludedtags=@version,@author,@todo fileset dir=${ant.common.eportal.services.dir}/src include name=**/portal/**/*.java / include name=**/reference/**/*.java / /fileset hibernate version=2.0 / /hibernatedoclet echo message=Regenerated Hibernate mapping files in ${basedir}\bin level=info / -- Jeff Mutonho GoogleTalk : ejbengine Skype: ejbengine Registered Linux user number 366042 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [m2] Frustration getting Maven 2 and Hibernate working together
Hello Paul Right now there is no snapshot version of the plugin since I have problems to deploy it to the snapshot server. So you have to download the source code of the plugin to your machine and do an mvn install that would install the plugin into your local repository. Then you just need to configure the plugin as described here: http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/howto.html Please let me know if you got any more problems. Regards Johann Reyes -Original Message- From: Paul Kuykendall [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 9:15 AM To: Maven Users List; Jose Gonzalez Gomez Subject: Re: [m2] Frustration getting Maven 2 and Hibernate working together I would be more appreciative than you can ever imagine if you could send that information. Thanks! /Paul On 7/5/06, Jose Gonzalez Gomez [EMAIL PROTECTED] wrote: Paul, It seems I've been able to run the hibernate plugin from the mojo successfully (at least it has created a table with a pair of attributes from an annotated class). I'm going out in a few minutes, so if you're interested in how I did it drop me a line (or drop it to the list) and I'll post excerpts from pom, settings, ... tomorrow. Best regards Jose 2006/7/5, Jose Gonzalez Gomez [EMAIL PROTECTED]: Paul, I'm trying to do the same, and I'm facing some troubles, maybe you can help me... First of all, I haven't been able to find one of the dependencies of the Hibernate Annotations packages: javax.persistence:ejb:jar:3.0-public-draft-20060502 . This seems to be an implementation of a public draft that has been removed from ibiblio. Anyway, I'm using the javax.persistence:persistence-api:1.0 from the java.netrepository. I guess this is the final implementation of the missing dependency, but I don't know how to override it or where to find it. How have you solved this? Best regards Jose 2006/7/5, Paul Kuykendall [EMAIL PROTECTED]: Hi, I am at my wits end in getting maven to play nicely with Hibernate. I've been at it for over a week now and feel no closer than when I started. Here's what I'm trying to do. I've been working on a project using Maven 2.0.4 as the build system. Everything has been going fine until I try and get Maven to generate the Hibernate DDL and java from my hbm files. I've tried using the codehaus hibernate3-maven-plugin with no success. I later discovered that when they had their crash, it took out lots of the plugin files. I've tried to just integrate the hibernate portions into the POM as a simple Ant task. I can't even get Maven to recognize the Ant tasks. I've RTFM (as much as there is one). I've tried all the available code snippets I can find. So far, nothing has worked. here is my POM file, slightly edited to protect the guilty. With the config files below, I don't even get the echos. If anyone has a sample section from the POM file for doing Hibernate 3 stuff, I would greatly appreciate a code-snippet. Thanks. /Paul ?xml version=1.0 encoding=UTF-8?project modelVersion4.0.0/modelVersion !-- POM Relationships -- groupIdcom.mycompany.simulators/groupId artifactIdcaisim/artifactId version 1.0-SNAPSHOT/version !-- parent groupIdcom.mycompany.simulators/groupId artifactIdsimulators/artifactId version1.0.0/version /parent -- dependencyManagement /dependencyManagement dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version /dependency dependency groupIdcommons-logging/groupId artifactIdcommons-logging/artifactId version1.0.4/version /dependency dependency groupIdcommons-configuration/groupId artifactIdcommons-configuration/artifactId version1.2/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version 3.2.0.cr2/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version 3.2.0.cr1/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-tools/artifactId version3.1.0.beta4 /version /dependency /dependencies modules /modules !-- Project Information -- nameMy Simulator/name descriptionMy interface simulator./description urlhttp://www.mycompany.com/url inceptionYear2006/inceptionYear licenses/licenses developers developer idmyname/id nameMy Name/name email[EMAIL PROTECTED]/email organization/organization roles roleDeveloper/role /roles timezone-6
RE: [m2] Frustration getting Maven 2 and Hibernate working together
Hello Paul Actually an update. I was able to go around the bug that was stopping me from deploying and was able to successfully deploy a snapshot. So now a hibernate3-maven-plugin is available to use. Regards Johann Reyes -Original Message- From: Paul Kuykendall [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 9:15 AM To: Maven Users List; Jose Gonzalez Gomez Subject: Re: [m2] Frustration getting Maven 2 and Hibernate working together I would be more appreciative than you can ever imagine if you could send that information. Thanks! /Paul On 7/5/06, Jose Gonzalez Gomez [EMAIL PROTECTED] wrote: Paul, It seems I've been able to run the hibernate plugin from the mojo successfully (at least it has created a table with a pair of attributes from an annotated class). I'm going out in a few minutes, so if you're interested in how I did it drop me a line (or drop it to the list) and I'll post excerpts from pom, settings, ... tomorrow. Best regards Jose 2006/7/5, Jose Gonzalez Gomez [EMAIL PROTECTED]: Paul, I'm trying to do the same, and I'm facing some troubles, maybe you can help me... First of all, I haven't been able to find one of the dependencies of the Hibernate Annotations packages: javax.persistence:ejb:jar:3.0-public-draft-20060502 . This seems to be an implementation of a public draft that has been removed from ibiblio. Anyway, I'm using the javax.persistence:persistence-api:1.0 from the java.netrepository. I guess this is the final implementation of the missing dependency, but I don't know how to override it or where to find it. How have you solved this? Best regards Jose 2006/7/5, Paul Kuykendall [EMAIL PROTECTED]: Hi, I am at my wits end in getting maven to play nicely with Hibernate. I've been at it for over a week now and feel no closer than when I started. Here's what I'm trying to do. I've been working on a project using Maven 2.0.4 as the build system. Everything has been going fine until I try and get Maven to generate the Hibernate DDL and java from my hbm files. I've tried using the codehaus hibernate3-maven-plugin with no success. I later discovered that when they had their crash, it took out lots of the plugin files. I've tried to just integrate the hibernate portions into the POM as a simple Ant task. I can't even get Maven to recognize the Ant tasks. I've RTFM (as much as there is one). I've tried all the available code snippets I can find. So far, nothing has worked. here is my POM file, slightly edited to protect the guilty. With the config files below, I don't even get the echos. If anyone has a sample section from the POM file for doing Hibernate 3 stuff, I would greatly appreciate a code-snippet. Thanks. /Paul ?xml version=1.0 encoding=UTF-8?project modelVersion4.0.0/modelVersion !-- POM Relationships -- groupIdcom.mycompany.simulators/groupId artifactIdcaisim/artifactId version 1.0-SNAPSHOT/version !-- parent groupIdcom.mycompany.simulators/groupId artifactIdsimulators/artifactId version1.0.0/version /parent -- dependencyManagement /dependencyManagement dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version3.8.1/version /dependency dependency groupIdcommons-logging/groupId artifactIdcommons-logging/artifactId version1.0.4/version /dependency dependency groupIdcommons-configuration/groupId artifactIdcommons-configuration/artifactId version1.2/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version 3.2.0.cr2/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-annotations/artifactId version 3.2.0.cr1/version /dependency dependency groupIdorg.hibernate/groupId artifactIdhibernate-tools/artifactId version3.1.0.beta4 /version /dependency /dependencies modules /modules !-- Project Information -- nameMy Simulator/name descriptionMy interface simulator./description urlhttp://www.mycompany.com/url inceptionYear2006/inceptionYear licenses/licenses developers developer idmyname/id nameMy Name/name email[EMAIL PROTECTED]/email organization/organization roles roleDeveloper/role /roles timezone-6/timezone /developer /developers contributors /contributors organization namemycompany, Inc./name urlhttp://www.mycompany.com/url /organization !-- Build Settings -- packagingjar/packaging properties
RE: Does anyone know how to use the maven DBUnit plugin?
Hello Ray Actually before the crash the hibernate3 plugin was going to be released, but the server crashed. Now after the crash I can't deploy a hibernate3 snapshot, I believe is a specific bug in cargo for me to deploy a successful snapshot, so I'm waiting for it to be fixed. As soon as I can successfully deploy again, I'll take it up to vote again and then release it. Regards Johann Reyes -Original Message- From: Ray Tsang [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 7:21 PM To: Maven Users List Subject: Re: Does anyone know how to use the maven DBUnit plugin? no problems rick. i was hoping that some useful plugins can be released... e.g. dbunit, hibernate3... but in the mean time, the only way i know of executing them are through ant tasks like that. ray, On 6/27/06, Rick [EMAIL PROTECTED] wrote: Thanks Ray. I found out the DBUnit Maven plugin is not done yet. This will come in handy. -Original Message- From: Ray Tsang [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 2:16 PM To: Maven Users List Subject: Re: Does anyone know how to use the maven DBUnit plugin? i'm using dbunit ant task to load initial data.. i have something like the following in profiles section of the pom.xml. it will execute when `mvn -DloadData=true` profile iddbunit-load-data/id activation property nameloadData/name valuetrue/value /property /activation build plugins plugin artifactIdmaven-antrun-plugin/artifactId executions execution idprocess-classes/id phaseprocess-classes/phase goals goalrun/goal /goals configuration tasks property value=CLEAN_INSERT name=operation / property value=src/test/sql/test-data.xml name=file / taskdef name=dbunit classname=org.dbunit.ant.DbUnitTask / dbunit driver=${database.driver} url=${database.url} userid=${database.username} password=${database.password} supportBatchStatement=false operation type=${operation} src=${file} format=xml / /dbunit /tasks /configuration /execution /executions dependencies dependency groupId${database.dependency.groupId}/groupId artifactId${database.dependency.artifactId}/artifactId version${database.dependency.version}/version /dependency dependency groupIddbunit/groupId artifactIddbunit/artifactId version2.1/version /dependency dependency groupIdant/groupId artifactIdant-nodeps/artifactId version1.6.5/version scopecompile/scope /dependency dependency groupIdcom.sun/groupId artifactIdtools/artifactId version1.5/version scopesystem/scope systemPath${java.home}/../lib/tools.jar/systemPath /dependency /dependencies /plugin /plugins /build /profile On 6/27/06, Rick Hightower [EMAIL PROTECTED] wrote: A sample pom.xml would be cool. I've used the DBUnit ant tasks and am looking for some sample for Maven2 and DBUnit. I looked around but there seem to be no DBUnit maven task documents. http://jroller.com/page/RickHigh?entry=getting_dbunit_to_work_with - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin:hbm2java - Setup Problems
Hello Suhneel Hmm looks like you are talking about the namingstrategy in hibernate, that you can find about it here: http://www.hibernate.org/hib_docs/v3/api/org/hibernate/cfg/NamingStrategy.ht ml Also thanks for the stacktrace, I'll have a fun weekend trying to tackle this, lol. If you need more help just let me know. Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 18, 2006 1:16 PM To: Maven Users List Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Sweet! This is exactly what I was looking for. Thanks for getting the plugin updated so quickly. There is one other small enhancement that would be nice - the generated POJO's use capital letters to start variable names that represent associated entities (other variables are fine). It would be nice (and more standardized) if they could adhere to the first letter lowercase rule when naming variables for associated entities. Thanks again, Johann. -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 6:08 PM To: 'Maven Users List' Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Hello Suhneel Yes, it would let you turn off generics ( 2 flags, jdk5 for generics and ejb3 for annotations ) even if you are using jdk 1.5 About Log4j, I'll research some more, with my test I don't have the need to include log4j in the pom.xml Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 8:58 PM To: Maven Users List Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems I haven't tried out the new snapshot yet - will it still let me use JDK 1.5 but only disable annotations (the documentation I read included a JDK5 flag, but made no mention of turning off only annotations in JDK 1.5)? I added the Log4J dependency to my POM, just like any other dependency. I'm using Hibernate 3.1.2. -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 5:12 PM To: 'Maven Users List' Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Hello Suhneel I just finished deploying a new snapshot that allows that, please refer to: http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/hbm2ja va-m ojo.html Regards Johann Reyes Ps also I'm looking into the log4j dependency, how did you add it? And also what exact version of hibernate are you using in your dependencies list? -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 6:15 PM To: Maven Users List Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems I got my problem figured out...I needed to add a dependency on log4j, which looks like it's being used by the internals of the mojo. I now have POJO's being generated from my Hibernate mapping files. I'm using JDK 1.5, but I would like annotations disabled (I would still like to use generics and autoboxing, however). I looked at the mojo API and the HibernateExporterMojo has an isAnnotationsEnabled property, which I would like to set to false. I tried setting it in various places in my POM, but none worked: 1. configuration isAnnotationsEnabled=false 2. configurationisAnnotationsEnabledfalse/isAnnotationsEnabled/confi guration 3. hbm2java isAnnotationsEnabled=false 4. hbm2javaisAnnotationsEnabledfalse/isAnnotationsEnabled/hbm2java Can I manually disable annotations, and if so, where is the correct place in my POM/Hibernate configuration to disable JDK 1.5 annotations? I would like to avoid changing my Java version back to 1.4 just for this goal, to avoid the creation of annotations in my POJO's. Thanks much. -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 1:32 PM To: 'Maven Users List' Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Hello Suhneel; Could you please run mvn -X hibernate3:hbm2java and send me the output? Also what jdk you are running? Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 3:34 PM To: Maven Users List Subject: hibernate3-maven-plugin:hbm2java - Setup Problems I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I would like to have the plugin generate POJO's from *.hbm.xml mapping files. Relevant portions of my project directory structure: Hibernate Configuration: project/src/main/resources/hibernate.cfg.xml Hibernate Mappings: project/src/main/resources/com/mycompany/app/*.hbm.xml Target directory for generated POJO's: project/src/main/java/com/mycompany/app/*.java POM snippet: . . . pluginRepositories pluginRepository idsnapshots/id urlhttp://snapshots.maven.codehaus.org/maven2/url /pluginRepository /pluginRepositories . . . plugin
RE: hibernate3-maven-plugin:hbm2java - Setup Problems
Hello Suhneel; Could you please run mvn -X hibernate3:hbm2java and send me the output? Also what jdk you are running? Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 3:34 PM To: Maven Users List Subject: hibernate3-maven-plugin:hbm2java - Setup Problems I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I would like to have the plugin generate POJO's from *.hbm.xml mapping files. Relevant portions of my project directory structure: Hibernate Configuration: project/src/main/resources/hibernate.cfg.xml Hibernate Mappings: project/src/main/resources/com/mycompany/app/*.hbm.xml Target directory for generated POJO's: project/src/main/java/com/mycompany/app/*.java POM snippet: . . . pluginRepositories pluginRepository idsnapshots/id urlhttp://snapshots.maven.codehaus.org/maven2/url /pluginRepository /pluginRepositories . . . plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration hibernate configurationFile/src/main/resources/hibernate.cfg.xml/configurationF ile /hibernate outputDirectory hbm2java/src/main/java/hbm2java /outputDirectory /configuration /plugin . . . Hibernate configuration snippet: . . . mapping resource=com/mycompany/app/TableOne.hbm.xml/ mapping resource=com/mycompany/app/TableTwo.hbm.xml/ mapping resource=com/mycompany/app/TableThree.hbm.xml/ . . When I run mvn hibernate3:hbm2java, I get an error and no POJO's are generated. The top of my stack trace is: java.lang.ExceptionInInitializerError at org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.createExport er(Hbm2JavaGeneratorMojo.java:52) Can someone please point out what I'm missing or doing wrong? Thanks. This message and any attachments are confidential, proprietary, and may be privileged. If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BGI. Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3-maven-plugin:hbm2java - Setup Problems
Hello Suhneel I just finished deploying a new snapshot that allows that, please refer to: http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/hbm2java-m ojo.html Regards Johann Reyes Ps also I'm looking into the log4j dependency, how did you add it? And also what exact version of hibernate are you using in your dependencies list? -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 6:15 PM To: Maven Users List Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems I got my problem figured out...I needed to add a dependency on log4j, which looks like it's being used by the internals of the mojo. I now have POJO's being generated from my Hibernate mapping files. I'm using JDK 1.5, but I would like annotations disabled (I would still like to use generics and autoboxing, however). I looked at the mojo API and the HibernateExporterMojo has an isAnnotationsEnabled property, which I would like to set to false. I tried setting it in various places in my POM, but none worked: 1. configuration isAnnotationsEnabled=false 2. configurationisAnnotationsEnabledfalse/isAnnotationsEnabled/confi guration 3. hbm2java isAnnotationsEnabled=false 4. hbm2javaisAnnotationsEnabledfalse/isAnnotationsEnabled/hbm2java Can I manually disable annotations, and if so, where is the correct place in my POM/Hibernate configuration to disable JDK 1.5 annotations? I would like to avoid changing my Java version back to 1.4 just for this goal, to avoid the creation of annotations in my POJO's. Thanks much. -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 1:32 PM To: 'Maven Users List' Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Hello Suhneel; Could you please run mvn -X hibernate3:hbm2java and send me the output? Also what jdk you are running? Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 3:34 PM To: Maven Users List Subject: hibernate3-maven-plugin:hbm2java - Setup Problems I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I would like to have the plugin generate POJO's from *.hbm.xml mapping files. Relevant portions of my project directory structure: Hibernate Configuration: project/src/main/resources/hibernate.cfg.xml Hibernate Mappings: project/src/main/resources/com/mycompany/app/*.hbm.xml Target directory for generated POJO's: project/src/main/java/com/mycompany/app/*.java POM snippet: . . . pluginRepositories pluginRepository idsnapshots/id urlhttp://snapshots.maven.codehaus.org/maven2/url /pluginRepository /pluginRepositories . . . plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration hibernate configurationFile/src/main/resources/hibernate.cfg.xml/configurationF ile /hibernate outputDirectory hbm2java/src/main/java/hbm2java /outputDirectory /configuration /plugin . . . Hibernate configuration snippet: . . . mapping resource=com/mycompany/app/TableOne.hbm.xml/ mapping resource=com/mycompany/app/TableTwo.hbm.xml/ mapping resource=com/mycompany/app/TableThree.hbm.xml/ . . When I run mvn hibernate3:hbm2java, I get an error and no POJO's are generated. The top of my stack trace is: java.lang.ExceptionInInitializerError at org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.createExport er(Hbm2JavaGeneratorMojo.java:52) Can someone please point out what I'm missing or doing wrong? Thanks. This message and any attachments are confidential, proprietary, and may be privileged. If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BGI. Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: hibernate3-maven-plugin:hbm2java - Setup Problems
Hello Suhneel Yes, it would let you turn off generics ( 2 flags, jdk5 for generics and ejb3 for annotations ) even if you are using jdk 1.5 About Log4j, I'll research some more, with my test I don't have the need to include log4j in the pom.xml Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 8:58 PM To: Maven Users List Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems I haven't tried out the new snapshot yet - will it still let me use JDK 1.5 but only disable annotations (the documentation I read included a JDK5 flag, but made no mention of turning off only annotations in JDK 1.5)? I added the Log4J dependency to my POM, just like any other dependency. I'm using Hibernate 3.1.2. -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 5:12 PM To: 'Maven Users List' Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Hello Suhneel I just finished deploying a new snapshot that allows that, please refer to: http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/hbm2ja va-m ojo.html Regards Johann Reyes Ps also I'm looking into the log4j dependency, how did you add it? And also what exact version of hibernate are you using in your dependencies list? -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 6:15 PM To: Maven Users List Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems I got my problem figured out...I needed to add a dependency on log4j, which looks like it's being used by the internals of the mojo. I now have POJO's being generated from my Hibernate mapping files. I'm using JDK 1.5, but I would like annotations disabled (I would still like to use generics and autoboxing, however). I looked at the mojo API and the HibernateExporterMojo has an isAnnotationsEnabled property, which I would like to set to false. I tried setting it in various places in my POM, but none worked: 1. configuration isAnnotationsEnabled=false 2. configurationisAnnotationsEnabledfalse/isAnnotationsEnabled/confi guration 3. hbm2java isAnnotationsEnabled=false 4. hbm2javaisAnnotationsEnabledfalse/isAnnotationsEnabled/hbm2java Can I manually disable annotations, and if so, where is the correct place in my POM/Hibernate configuration to disable JDK 1.5 annotations? I would like to avoid changing my Java version back to 1.4 just for this goal, to avoid the creation of annotations in my POJO's. Thanks much. -Original Message- From: Johann Reyes [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 1:32 PM To: 'Maven Users List' Subject: RE: hibernate3-maven-plugin:hbm2java - Setup Problems Hello Suhneel; Could you please run mvn -X hibernate3:hbm2java and send me the output? Also what jdk you are running? Regards Johann Reyes -Original Message- From: Roye, Suhneel BGI SF [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 3:34 PM To: Maven Users List Subject: hibernate3-maven-plugin:hbm2java - Setup Problems I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I would like to have the plugin generate POJO's from *.hbm.xml mapping files. Relevant portions of my project directory structure: Hibernate Configuration: project/src/main/resources/hibernate.cfg.xml Hibernate Mappings: project/src/main/resources/com/mycompany/app/*.hbm.xml Target directory for generated POJO's: project/src/main/java/com/mycompany/app/*.java POM snippet: . . . pluginRepositories pluginRepository idsnapshots/id urlhttp://snapshots.maven.codehaus.org/maven2/url /pluginRepository /pluginRepositories . . . plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration hibernate configurationFile/src/main/resources/hibernate.cfg.xml/configurationF ile /hibernate outputDirectory hbm2java/src/main/java/hbm2java /outputDirectory /configuration /plugin . . . Hibernate configuration snippet: . . . mapping resource=com/mycompany/app/TableOne.hbm.xml/ mapping resource=com/mycompany/app/TableTwo.hbm.xml/ mapping resource=com/mycompany/app/TableThree.hbm.xml/ . . When I run mvn hibernate3:hbm2java, I get an error and no POJO's are generated. The top of my stack trace is: java.lang.ExceptionInInitializerError at org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.createExport er(Hbm2JavaGeneratorMojo.java:52) Can someone please point out what I'm missing or doing wrong? Thanks. This message and any attachments are confidential, proprietary, and may be privileged. If this message was misdirected, Barclays Global Investors (BGI) does
RE: [m2.0.3] idea:idea = StringIndexOutOfBoundsException
Hello Wesslan One question, have you run mvn idea:idea previously with maven 2.0.2? Regards Johann Reyes -Original Message- From: Wesslan [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 2:05 AM To: users@maven.apache.org Subject: [m2.0.3] idea:idea = StringIndexOutOfBoundsException When I try run to mvn idea:idea for my project, I get the following exception: [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'idea'. [INFO] [INFO] Building secret app [INFO]task-segment: [idea:idea] [INFO] [INFO] Preparing idea:idea [INFO] No goals needed for project - skipping [INFO] [idea:idea] [INFO] [ERROR] FATAL ERROR [INFO] [INFO] String index out of range: -1 [INFO] [INFO] Trace java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1768) at java.lang.String.substring(String.java:1735) at org.apache.maven.plugin.idea.IdeaMojo.toRelative(IdeaMojo.java:395) at org.apache.maven.plugin.idea.IdeaMojo.getModuleFileUrl(IdeaMojo.java:409) at org.apache.maven.plugin.idea.IdeaMojo.addSourceFolder(IdeaMojo.java:382) at org.apache.maven.plugin.idea.IdeaMojo.rewriteModule(IdeaMojo.java:255) at org.apache.maven.plugin.idea.IdeaMojo.execute(IdeaMojo.java:79) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Any ideas? Regards Peter -- View this message in context: http://www.nabble.com/-m2.0.3-idea%3Aidea-%3D%3E-StringIndexOutOfBoundsExcep tion-t1373009.html#a3684560 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Quick explanation requested
Hello Miike About point 2: You would need to manually add (mvn install:install-file) a dependency when they cannot be found in ibiblio. In the example that you gave, that jar along others from Sun (like Transaction, and Mail) it wouldn't be found in ibiblio thanks to licensing issues about the distribution of the jar, it cannot be added to ibiblio thus you have to manually go and download the jar from Sun and install it. Regards Johann Reyes -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 8:59 AM To: Maven Users List Subject: Quick explanation requested I'd appreciate if someone can shed some light on 2 points. 1) Why is it a good idea to have a complete app stored on ibiblio including source? Is there any safeguards as to who can download these projects (i.e. what security is in place, for example if someone knows or guesses your artifactId)? 2) Why would we initate the following command below, if we get all the plugin components initally when we download any goal the first time? mvn install:install-file -DgroupId=javax.activation -DartifactId=activation -Dversion=1.0.2 -Dpackaging=jar -Dfile=/ Thanks. -- Miike Tedesco -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classpaths and more hibernate foo
Hello Peter For the jdbc drivers, you need to use it as an extension for it to be available to hibernate as described here: http://mojo.codehaus.org/hibernate3-maven-plugin/howto.html Regards Johann Reyes -Original Message- From: Peter L. Berghold [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 8:38 AM To: users@maven.apache.org Subject: classpaths and more hibernate foo -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 OK, So I've gotten the hibernate plug-in doing some stuff for me. I've got it creating POJOS from foo.hbm.xml files and I have it creating hibernate.cfg.xml from my database.properties files and the various foo.hbm.xml files. Groovy. So now I want to create my schema, I invoke mvn hibernate:schema-export I and see lots of spew and somewhere buried in there is a message saying: java.sql.SQLException: No suitable driver What? That's crazy talk! I check my pom.xml file and sure enough I have dependency groupIdpostgresql/groupId artifactIdpostgresql/artifactId version8.1-404.jdbc3/version scopecompile/scope /dependency among other dependencies that I feel my project has. I do some reading and I read on the maven website under scope the following: Compile dependencies are available in all classpaths. OK: I'm thick-headed... what am I missing here? Shouldn't the postgres JDBC drivers be available to the schema export task? What's the magic foo that makes it so? - -- Peter L. Berghold [EMAIL PROTECTED] Those who fail to learn from history are condemned to repeat it. AIM: redcowdawgYahoo IM: blue_cowdawg ICQ: 11455958 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFEKTw2UM9/01RIhaARAhVAAJ0ewh45+mg8VBxrIU7nGWL60wLMmQCgrY31 7ZJpQ84oDwFsW3LE7ZUi2aM= =UeEJ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem hibernate3 plugin cfg2cfgxml
Hi Bigalk Right now the hibernate3-maven-plugin is available as a snapshot only and it is a maven 2.x plugin. You can find information about the plugin here: http://mojo.codehaus.org/hibernate3-maven-plugin If you have any other question, please feel free to ask. Regards Johann Reyes -Original Message- From: O. Bigalk [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 8:44 AM To: users@maven.apache.org Subject: Re: Problem hibernate3 plugin cfg2cfgxml Hi Taavi, where can I get the hibernate3-maven-plugin ? I found some documentation on it on codehaus.org but I didn't see any binary distribution of it. I also checked the source repository at svn.mojo.codehaus.org but the source distribution seems also incomplet regarding to its dependencies. Does the hibernate3-maven-plugin run with maven 1.0.2 ? -- View this message in context: http://www.nabble.com/Problem-hibernate3-plugin-cfg2cfgxml-t1310262.html#a36 29767 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: wither the hibernate3 plugin?
As per the documentation found here: http://maven.apache.org/guides/development/guide-testing-development-plugins .html the pluginRepositories format should be like the following: pluginRepositories pluginRepository idsnapshots/id urlhttp://snapshots.maven.codehaus.org/maven2/url /pluginRepository /pluginRepositories Regards Johann Reyes -Original Message- From: Peter L. Berghold [mailto:[EMAIL PROTECTED] Sent: Monday, March 27, 2006 2:36 PM To: [EMAIL PROTECTED] Cc: users@maven.apache.org Subject: Re: wither the hibernate3 plugin? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: Hey Peter, I think you looked in the wrong place. This would be the correct URL: http://snapshots.maven.codehaus.org/maven2/org/codehaus/mojo/hibernate3- maven-plugin/ OK... but why the error? - -- Peter L. Berghold [EMAIL PROTECTED] Those who fail to learn from history are condemned to repeat it. AIM: redcowdawgYahoo IM: blue_cowdawg ICQ: 11455958 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFEKD6oUM9/01RIhaARAoUKAJ47OW3BLgkfYr66pVBGuOMwXBOUSQCaArGW y0S5NEr0tY0PL4e+xtUGhZc= =PI6B -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: wither the hibernate3 plugin?
For licensing issues, it can not be included in ibiblio. You can download it from here: http://prdownloads.sourceforge.net/hibernate/hibernate-annotations-3.1beta8. zip?download Just rename the ejb-persistence.jar to ejb-3.0-public-draft-20060118.jar Regards Johann Reyes -Original Message- From: Peter L. Berghold [mailto:[EMAIL PROTECTED] Sent: Monday, March 27, 2006 3:03 PM To: Johann Reyes Cc: 'Maven Users List' Subject: Re: wither the hibernate3 plugin? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Johann Reyes wrote: the pluginRepositories format should be like the following: That solved the immediate problem and now I've careened into the next problem. required artifacts missing: javax.persistence:ejb:jar:3.0-public-draft-20060118 for the artifact: org.codehaus.mojo:hibernate3-maven-plugin:maven-plugin:1.0-20060323.212212-5 I took a look in the various repositories that I know of and once again I don't see the jar file that I'm looking for. OK: I've solved this problem once with javax.transaction.jta and installed the jar file from Scum Microsystems and that's hunky dory now. I'm looking around for a download for this now and can't find anything but the JDK which I've already downloaded and I'm not seeing a jar file there either. Maddening... - -- Peter L. Berghold [EMAIL PROTECTED] Those who fail to learn from history are condemned to repeat it. AIM: redcowdawgYahoo IM: blue_cowdawg ICQ: 11455958 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFEKEUCUM9/01RIhaARAjyQAKCBniqTooqJ7jwtWwxs77PVEvmltwCeIBxN EvwnZ7CZjQiJZPR96PFWPdo= =8Oq0 -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best practices with respect to hibernate.
Hello Peter Right now I'm working in multiple output directory assignment for the hibernate-plugin and also automatic discovery for annotated classes when you want to build the hibernate.cfg.xml file from annotated classes, so it should ready by the end of week most likely Regards Johann Reyes -Original Message- From: Peter L. Berghold [mailto:[EMAIL PROTECTED] Sent: Monday, March 27, 2006 4:39 PM To: Maven Users List Subject: Best practices with respect to hibernate. -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 OK... I'm slow... it is taking me some doing to get my mind around how maven does things. I've finally got the hibernate plugin generating my pojos for me from configuration files. It wants to put the resultant pojos in /target/hibernate-tools which would be fine except when I do an install the class files do not show up in my jar file as they should. What are other folks using hibernate doing in terms of setting up goals? My goal here is to define my ORM using *hbm.xml files and generate my pojos from there, compile those along with some other glue classes and make a package for my webapp to use. I've already got the multiple module thing working for me. I tried overriding the outputDirectory configuration value and got squawked at by maven that this is a read only value. (darn it!) - -- Peter L. Berghold [EMAIL PROTECTED] Those who fail to learn from history are condemned to repeat it. AIM: redcowdawgYahoo IM: blue_cowdawg ICQ: 11455958 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Red Hat - http://enigmail.mozdev.org iD8DBQFEKFuFUM9/01RIhaARArWjAJ4y/nqzoBPR6GQEkg8+ZFbWib8xLwCgo3kk HwX7YS9fhN3nqyy7BZcldkE= =KXKN -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem hibernate3 plugin cfg2cfgxml
Heelo Taavi: You can find an example here: jdk4: https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven-plugi n/src/test/project-jdk14 jd5: https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven-plugi n/src/test/project-jdk15 Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 6:13 AM To: Maven Users List Subject: Re: Problem hibernate3 plugin cfg2cfgxml Hey Sylvain, If this is not so big trouble can you send me some sample pom.xml, from I can learn how to configure your plugin? Taavi Sylvain Vieujot wrote: I filled a Jira new feature request where you can find the source code attached : http://jira.codehaus.org/browse/MHIBERNATE-1 Hope this helps. Sylvain. On Tue, 2006-03-21 at 12:56 -0500, Johann Reyes wrote: Hello Sylvian Yes, I would be interested to take a look, I'll gladly accept the help. And don't worry, the implementation I think would be fairly easy since I know when a person is using annotations or not. Thanks Johann Reyes -Original Message- From: Sylvain Vieujot [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 11:39 AM To: Maven Users List Subject: RE: Problem hibernate3 plugin cfg2cfgxml I did a private maven plugin that does just that : Fetch the annotations and add the mapping class=.../ to an hibernate.cfg.xml file. It would need to be a bite polished to go in a public repository, but if you're interested, I could review it a bite to contribute it. It works only for annotations though, but it can be combined with the xdoclet plugin for the one that need to mix them Best regards, Sylvain Vieujot. On Tue, 2006-03-21 at 08:39 -0500, Johann Reyes wrote: Hello Taavi Right now, hibernate-tools supports creation of hibernate.cfg.xml with mappings automatically only with hbm.xml files. I'll check if they are planning to support Annotations this way too, but at the moment is not supported. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 8:33 AM To: Maven Users List Subject: Re: Problem hibernate3 plugin cfg2cfgxml Hey, But is there any way to create hibernate.cfg.xml with mappings automatically or I really write it manually? Maby same ant task, or other tool, preferably maven 2 :) Taavi Johann Reyes wrote: Hello Taavi Ahh sorry, my mistake, I run my test, but I had the a hibernate.cfg.xml al;ready setup and didn't notice that. After doing a little more research, the goal cfg2cfgxml is more for hbm files, since annotated classes there is no other way around that to have it specified in a hibernate.cfg.xml file as per http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#setu p-configuration As it states there is no other way around. I'll keep looking into it to see if I can find a workaround but for that moment I have to say that you need to initially have a hibernate.cfg.xml file before using annotations with hibernate. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 2:27 AM To: Johann Reyes; users@maven.apache.org Subject: Re: Problem hibernate3 plugin cfg2cfgxml Thank you Johann for so quick answer. Yes a have set the ejb3 to true. Here is my pom.xml configuration: build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration ejb3true/ejb3 config /target/hibernatetools/hibernate.cfg.xml /config jdk5true/jdk5 outputFile target/hibernatetools/db-schema.sql /outputFile properties /src/main/resources/hibernate.properties /properties /configuration /plugin /plugins extensions extension groupIdoracle/groupId artifactIdjdbc/artifactId version10.2.0.1.0/version /extension /extensions /build And hibernate properties is following: hibernate.connection.driver_class = oracle.jdbc.driver.OracleDriver hibernate.connection.url = jdbc:oracle:thin:@localhost:1521:orcl hibernate.connection.username = blablah hibernate.connection.password = blablah hibernate.dialect = org.hibernate.dialect.Oracle9Dialect Can you suggest what else could be wrong? Taavi Johann Reyes wrote: Hello Taavi Did you set the ejb3 parameter to true? You can see an example here: https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox
RE: Problem hibernate3 plugin cfg2cfgxml
Hello Sylvain Based in your plugin, I have added now the ability to support the auto discovery of hibernate annotated classes to the plugin. If you like please try it. Regards Johann Reyes -Original Message- From: Sylvain Vieujot [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 9:40 AM To: [EMAIL PROTECTED] Cc: Maven Users List Subject: Re: Problem hibernate3 plugin cfg2cfgxml I sometime have problems like this. Try to do an mvn clean before. For me it solved the problem. On Wed, 2006-03-22 at 16:10 +0200, Taavi Sildeberg wrote: Hello Sylvain, When I try to use your plugin, I got this result from it: C:\devTest\timemanager\datamvn hibernate-annotations:mappings-compile [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'hibernate-annotations'. Downloading: http://repo1.maven.org/maven2/oracle/jdbc/10.2.0.1.0/jdbc-10.2.0.1.0.pom [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2) [INFO] [INFO] Building TimeManager Data Module [INFO]task-segment: [hibernate-annotations:mappings-compile] [INFO] [INFO] [hibernate-annotations:mappings-compile] java.lang.NoClassDefFoundError: C:\devTest\timemanager\data\target\classes\ee\zero\data\user\Address (wrong name: ee/zero/data/user/Address) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.lang.ClassLoader.defineClass(ClassLoader.java:465) at com.seanergie.maven.plugins.FileClassLoader.getClassFromFile(FileClassLoader .java:54) at com.seanergie.maven.plugins.FileClassLoader.shouldBeMapped(FileClassLoader.j ava:84) at com.seanergie.maven.plugins.AbstractHibernate.execute(AbstractHibernate.java :82) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:415) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:531) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:485) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:455) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:303) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:270) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:139) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] Dependencies : [Ljava.net.URL;@2a15cd java.lang.NoClassDefFoundError: C:\devTest\timemanager\data\target\classes\ee\zero\data\user\CopyOfUser (wrong name: ee/zero/data/user/CopyOfUser) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.lang.ClassLoader.defineClass(ClassLoader.java:465) at com.seanergie.maven.plugins.FileClassLoader.getClassFromFile(FileClassLoader .java:54) at com.seanergie.maven.plugins.FileClassLoader.shouldBeMapped(FileClassLoader.j ava:84) at com.seanergie.maven.plugins.AbstractHibernate.execute(AbstractHibernate.java :82) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:415) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:531) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:485) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:455) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:303
RE: Problem hibernate3 plugin cfg2cfgxml
Hello Taavi Ahh sorry, my mistake, I run my test, but I had the a hibernate.cfg.xml al;ready setup and didn't notice that. After doing a little more research, the goal cfg2cfgxml is more for hbm files, since annotated classes there is no other way around that to have it specified in a hibernate.cfg.xml file as per http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#setu p-configuration As it states there is no other way around. I'll keep looking into it to see if I can find a workaround but for that moment I have to say that you need to initially have a hibernate.cfg.xml file before using annotations with hibernate. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 2:27 AM To: Johann Reyes; users@maven.apache.org Subject: Re: Problem hibernate3 plugin cfg2cfgxml Thank you Johann for so quick answer. Yes a have set the ejb3 to true. Here is my pom.xml configuration: build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration ejb3true/ejb3 config /target/hibernatetools/hibernate.cfg.xml /config jdk5true/jdk5 outputFile target/hibernatetools/db-schema.sql /outputFile properties /src/main/resources/hibernate.properties /properties /configuration /plugin /plugins extensions extension groupIdoracle/groupId artifactIdjdbc/artifactId version10.2.0.1.0/version /extension /extensions /build And hibernate properties is following: hibernate.connection.driver_class = oracle.jdbc.driver.OracleDriver hibernate.connection.url = jdbc:oracle:thin:@localhost:1521:orcl hibernate.connection.username = blablah hibernate.connection.password = blablah hibernate.dialect = org.hibernate.dialect.Oracle9Dialect Can you suggest what else could be wrong? Taavi Johann Reyes wrote: Hello Taavi Did you set the ejb3 parameter to true? You can see an example here: https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven- plugin/src/test/project-jdk15/pom.xml Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 5:30 AM To: Maven Users List Subject: Problem hibernate3 plugin cfg2cfgxml Hello, I have a three java files with annotations. When I try to generate the hibernate.cfg.xml with maven.hibernte3.plugin, then the mapped classes are never included inside hibernate.cfg.xml file. If I add them manualy then hbm2ddl works fine. In the plugin manual is that hibernate3:cfg2cfgxml generates hibernate.cfg.xml. file Can someone suggest what I am doing wrong? Taavi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem hibernate3 plugin cfg2cfgxml
Hello Taavi Right now, hibernate-tools supports creation of hibernate.cfg.xml with mappings automatically only with hbm.xml files. I'll check if they are planning to support Annotations this way too, but at the moment is not supported. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 8:33 AM To: Maven Users List Subject: Re: Problem hibernate3 plugin cfg2cfgxml Hey, But is there any way to create hibernate.cfg.xml with mappings automatically or I really write it manually? Maby same ant task, or other tool, preferably maven 2 :) Taavi Johann Reyes wrote: Hello Taavi Ahh sorry, my mistake, I run my test, but I had the a hibernate.cfg.xml al;ready setup and didn't notice that. After doing a little more research, the goal cfg2cfgxml is more for hbm files, since annotated classes there is no other way around that to have it specified in a hibernate.cfg.xml file as per http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#setu p-configuration As it states there is no other way around. I'll keep looking into it to see if I can find a workaround but for that moment I have to say that you need to initially have a hibernate.cfg.xml file before using annotations with hibernate. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 2:27 AM To: Johann Reyes; users@maven.apache.org Subject: Re: Problem hibernate3 plugin cfg2cfgxml Thank you Johann for so quick answer. Yes a have set the ejb3 to true. Here is my pom.xml configuration: build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration ejb3true/ejb3 config /target/hibernatetools/hibernate.cfg.xml /config jdk5true/jdk5 outputFile target/hibernatetools/db-schema.sql /outputFile properties /src/main/resources/hibernate.properties /properties /configuration /plugin /plugins extensions extension groupIdoracle/groupId artifactIdjdbc/artifactId version10.2.0.1.0/version /extension /extensions /build And hibernate properties is following: hibernate.connection.driver_class = oracle.jdbc.driver.OracleDriver hibernate.connection.url = jdbc:oracle:thin:@localhost:1521:orcl hibernate.connection.username = blablah hibernate.connection.password = blablah hibernate.dialect = org.hibernate.dialect.Oracle9Dialect Can you suggest what else could be wrong? Taavi Johann Reyes wrote: Hello Taavi Did you set the ejb3 parameter to true? You can see an example here: https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven- plugin/src/test/project-jdk15/pom.xml Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 5:30 AM To: Maven Users List Subject: Problem hibernate3 plugin cfg2cfgxml Hello, I have a three java files with annotations. When I try to generate the hibernate.cfg.xml with maven.hibernte3.plugin, then the mapped classes are never included inside hibernate.cfg.xml file. If I add them manualy then hbm2ddl works fine. In the plugin manual is that hibernate3:cfg2cfgxml generates hibernate.cfg.xml. file Can someone suggest what I am doing wrong? Taavi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem hibernate3 plugin cfg2cfgxml
Hello Sylvian Yes, I would be interested to take a look, I'll gladly accept the help. And don't worry, the implementation I think would be fairly easy since I know when a person is using annotations or not. Thanks Johann Reyes -Original Message- From: Sylvain Vieujot [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 11:39 AM To: Maven Users List Subject: RE: Problem hibernate3 plugin cfg2cfgxml I did a private maven plugin that does just that : Fetch the annotations and add the mapping class=.../ to an hibernate.cfg.xml file. It would need to be a bite polished to go in a public repository, but if you're interested, I could review it a bite to contribute it. It works only for annotations though, but it can be combined with the xdoclet plugin for the one that need to mix them Best regards, Sylvain Vieujot. On Tue, 2006-03-21 at 08:39 -0500, Johann Reyes wrote: Hello Taavi Right now, hibernate-tools supports creation of hibernate.cfg.xml with mappings automatically only with hbm.xml files. I'll check if they are planning to support Annotations this way too, but at the moment is not supported. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 8:33 AM To: Maven Users List Subject: Re: Problem hibernate3 plugin cfg2cfgxml Hey, But is there any way to create hibernate.cfg.xml with mappings automatically or I really write it manually? Maby same ant task, or other tool, preferably maven 2 :) Taavi Johann Reyes wrote: Hello Taavi Ahh sorry, my mistake, I run my test, but I had the a hibernate.cfg.xml al;ready setup and didn't notice that. After doing a little more research, the goal cfg2cfgxml is more for hbm files, since annotated classes there is no other way around that to have it specified in a hibernate.cfg.xml file as per http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#setu p-configuration As it states there is no other way around. I'll keep looking into it to see if I can find a workaround but for that moment I have to say that you need to initially have a hibernate.cfg.xml file before using annotations with hibernate. Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 2:27 AM To: Johann Reyes; users@maven.apache.org Subject: Re: Problem hibernate3 plugin cfg2cfgxml Thank you Johann for so quick answer. Yes a have set the ejb3 to true. Here is my pom.xml configuration: build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId configuration ejb3true/ejb3 config /target/hibernatetools/hibernate.cfg.xml /config jdk5true/jdk5 outputFile target/hibernatetools/db-schema.sql /outputFile properties /src/main/resources/hibernate.properties /properties /configuration /plugin /plugins extensions extension groupIdoracle/groupId artifactIdjdbc/artifactId version10.2.0.1.0/version /extension /extensions /build And hibernate properties is following: hibernate.connection.driver_class = oracle.jdbc.driver.OracleDriver hibernate.connection.url = jdbc:oracle:thin:@localhost:1521:orcl hibernate.connection.username = blablah hibernate.connection.password = blablah hibernate.dialect = org.hibernate.dialect.Oracle9Dialect Can you suggest what else could be wrong? Taavi Johann Reyes wrote: Hello Taavi Did you set the ejb3 parameter to true? You can see an example here: https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven- plugin/src/test/project-jdk15/pom.xml Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 5:30 AM To: Maven Users List Subject: Problem hibernate3 plugin cfg2cfgxml Hello, I have a three java files with annotations. When I try to generate the hibernate.cfg.xml with maven.hibernte3.plugin, then the mapped classes are never included inside hibernate.cfg.xml file. If I add them manualy then hbm2ddl works fine. In the plugin manual is that hibernate3:cfg2cfgxml generates hibernate.cfg.xml. file Can someone suggest what I am doing wrong? Taavi
RE: Problem hibernate3 plugin cfg2cfgxml
Hello Taavi Did you set the ejb3 parameter to true? You can see an example here: https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven- plugin/src/test/project-jdk15/pom.xml Regards Johann Reyes -Original Message- From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 5:30 AM To: Maven Users List Subject: Problem hibernate3 plugin cfg2cfgxml Hello, I have a three java files with annotations. When I try to generate the hibernate.cfg.xml with maven.hibernte3.plugin, then the mapped classes are never included inside hibernate.cfg.xml file. If I add them manualy then hbm2ddl works fine. In the plugin manual is that hibernate3:cfg2cfgxml generates hibernate.cfg.xml. file Can someone suggest what I am doing wrong? Taavi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [M2] IntelliJ Idea plugin and jdkName
Hello Andreas, The correct values would be: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-idea-plugin/artifactId configuration jdkName1.4/jdkName /configuration /plugin Regards Johann Reyes -Original Message- From: Andreas Guther [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 4:15 PM To: Maven Users List Subject: [M2] IntelliJ Idea plugin and jdkName Hi, Does anyone know how to configure the idea plug-in to use a specific JDK version? The documentation reads to set the jdkName, but does not tell where: http://maven.apache.org/plugins/maven-idea-plugin/idea-mojo.html I tried to configure the plug-in in my build section with the following, but that seems not the right groupId and artifactId. What are the correct values? plugin groupIdidea/groupId artifactIdidea/artifactId configuration jdkName1.4/jdkName /configuration /plugin Thanks in advance, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [m2] Hibernate doclet
Hello Andres About xdoclet2 1) Yes, there are changes like that, but mostly they are minimal if you don't use many collections in your objects. 2) The empty query is because you are breaking your queries in 2 or more lines, with queries, you just have to create the whole query in one line or else the query just breaks and your hibernate mapping with it. Regards Johann Reyes -Original Message- From: Akbarr [mailto:[EMAIL PROTECTED] Sent: Sunday, February 26, 2006 5:35 PM To: users Subject: [m2] Hibernate doclet I'm migrating my projects from Ant to Maven, and I've found a problem when trying to run Hibernate Doclet from Maven 2. I've tried to: * Run Ant code with antrun plugin * Make an Ant plug-in running Hibernate doclet * Use hibernatedoclet-maven-plugin from org.codehaus.mojo After dealing with sever classpath issues, I obtain the same results in every three choices: Embedded error: Can't create a hibernate element under hibernatedoclet. Make sure the jar file containing the corresponding subtask class is on the classpath specified in the taskdef that defined {2}. There's another choice, which is to migrate to XDoclet2, but I've seen that although it works fine: * The hibernate tags are sligthly different, e.g. collection-key is just key in XDoclet2 * I've found at least one error: when declaring a query, the generated XML has an empty representation node into the query, which finally raises a validation error. I'm sure that someone must have been in a similar case before, so any suggestion, please?. Have I done anything wrong? Andrés - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: [m2] Hibernate doclet
Hello Andres 1) Not much documentation sadly, but I say it's pretty straightforward. If you have problems remapping something you can just send me an email or find me at irc://irc.codehaus.org/#maven 2) Use the 1.0.3 version of xdoclet-plugin-hibernate instead of 1.0.4-SNAPSHOT and give it a try Regards Johann Reyes -Original Message- From: Akbarr [mailto:[EMAIL PROTECTED] Sent: Sunday, February 26, 2006 7:41 PM To: Maven Users List Subject: Re: RE: [m2] Hibernate doclet Thanks Johann: About xdoclet2 1) Yes, there are changes like that, but mostly they are minimal if you don't use many collections in your objects. Is there documentation about the differences between Hibernate xdoclet and xdoclet2?. I mean, the only difference is to replace collection-xxx tags for just xxx?. I only noticed the obvious errors. 2) The empty query is because you are breaking your queries in 2 or more lines, with queries, you just have to create the whole query in one line or else the query just breaks and your hibernate mapping with it. No, the query is in just 1 line: /** * @hibernate.class table=I18N_Textos * * @hibernate.query name=getTextoI18N query=from I18NTextos i where i.locale=:locale and i.texto=:texto * */ The generated XML is: query name=getTextoI18N representation/![CDATA[from I18NTextos i where i.locale=:locale and i.texto=:texto]] /query (the representation node raises an error) And the pom.xml: plugin groupIdxdoclet/groupId artifactIdmaven2-xdoclet2-plugin/artifactId configuration configs config pluginorg.xdoclet.plugin.hibernate.HibernateMappingPlugin/plugin params version2.0/version destdir${basedir}/target/classes//destdir /params /config /configs /configuration dependencies dependency groupIdxdoclet-plugins/groupId artifactIdxdoclet-plugin-hibernate/artifactId version1.0.4-SNAPSHOT/version /dependency /dependencies executions execution goals goalxdoclet/goal /goals /execution /executions /plugin Thanks in advance, Andrés - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hibernate3 plugin
Hello Michal The main difference is that while the hibernate3-maven-plugin is based on hibernate-tools (http://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html) and can do more tasks like create a database schema base in your POJOs or generate a database documentation (kind of javadoc) also based in your POJOS Regards Johann Reyes -Original Message- From: Jacek Laskowski [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 15, 2006 2:03 AM To: Maven Users List Subject: Re: hibernate3 plugin 06-02-13, Michal Palička [EMAIL PROTECTED] napisał(a): the Hibernate3 plugin can be found at the mojo-sandbox. Hi, (Since it's the users mailing list I hope such irritating questionsare acceptable ;)) What's the difference between the Hibernate3 plugin hosted at themojo-sandbox and the XDoclet2 Hibernate plugin for Maven2? Michal Palicka Jacek --Jacek Laskowskihttp://www.laskowski.org.pl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [m2] Hibernate3 SchemaExportTask
Hi Frederik Right now I'm fixing the plugin to a workable state again. So if you can check in a few days while some dependencies get uploaded to ibiblio, you'll get a workable plugin once again. Regards Johann Reyes -Original Message- From: Jason van Zyl [mailto:[EMAIL PROTECTED] Sent: Saturday, January 28, 2006 9:40 PM To: Maven Users List Subject: Re: [m2] Hibernate3 SchemaExportTask Frederik Dierickx wrote: Hi, I'm a recent convert to Maven2 and trying to achieve the same functionality I used to do with Ant. Most of the things work pretty well but one of the things I really got stuck on is the SchemaExportTask using Hibernate3. I tried to install the hibernate3 plugin from the codehaus mojo repository but didn't succeed because of missing dependencies. Another way I am currently trying is simply calling the SchemaExportTask using an Ant call. Using this approach, it seems like the SchemaExportTask cannot be found in the classpath. I do have a dependency on Hibernate3 in my POM and am passing a reference to maven.dependency.classpath to and maven-antrun-plugin. For some reason unclear to me it doesn't seem to work out. The hibernate3 plugin is currently in the sandbox so no guarantees there. As a stopgap you can use the antrun plugin in conjunction with the ant tasks that you are used to. I'd encourage you to give feedback to get the hib3 plugin working but use the antrun plugin if you have to: http://maven.apache.org/plugins/maven-antrun-plugin/ -- jvz. Jason van Zyl jason at maven.org http://maven.apache.org A man enjoys hsi work when he understands the whole and when he is responsible for the quality of the whole -- Christopher Alexander, A Pattern Language - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: status of hibernate plugin for m2?
Hello Phillip, what version of hibernate 2 or 3? There are plug-ins for both versions, that you find it in http://mojo.codehaus.org/ Regards Johann Reyes -Original Message- From: phillip rhodes [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 02, 2005 9:08 AM To: users@maven.apache.org Subject: status of hibernate plugin for m2? I have a project that will be using hibernate, but it appears that the hibernate plugin has not been developed yet for maven 2. Can someone confirm this for me? Thank you! Phillip Rhodeshttp://www.jsso.org Open source Java Identity and Authorization Serviceshttp://www.rhoderunner.com Open Source Java Ecommerce Suite - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [M2] Hibernate plugin
Hello Jose If you need annotations support I put something together quickly for a project I'm working on. You can get it from here: http://www.hiberforum.org/2005/09/maven2_hibernate_and_dbunit_pl.html and also there it specifies where you can get the source code from it. Regards Johann Reyes