So, the below setup works, but how do I deal with multiple JPA units? Using
<persistenceunit> does not work...neither does listing all units in the same
tag with commas separating the names...
Does the plugin supports multiple JPAs in multiple dependent jars?
Thanks,
===
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<verbose>true</verbose>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
<component>
<name>hbm2hbmxml</name>
</component>
</components>
<componentProperties>
<drop>false</drop>
<jdk5>true</jdk5>
<scan-jars>true</scan-jars>
<scan-classes>true</scan-classes>
<persistenceunit>xyz-domain</persistenceunit>
<!--
<configurationfile>../ecs-services/src/main/resources/ecs.hibernate.cfg.xml</configurationfile>
-->
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>opensource</groupId>
<artifactId>mysql</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
--- On Wed, 10/8/08, Coder One <[EMAIL PROTECTED]> wrote:
> From: Coder One <[EMAIL PROTECTED]>
> Subject: [mojo-user] hibernate3-maven-plugin & Jar Scanning
> To: [email protected]
> Date: Wednesday, October 8, 2008, 10:23 PM
> I have my JPA/Hibernate annotated classes in 2 separate
> jars. The sysinit project declares dependencies on the 2
> jars. I am trying to auto-generate my scehema using the
> hibernate3-maven-plugin without having to specify
> hibernate.cfg.xml
>
> If I leave out scan-classes, nothing happens. If it stays
> (see pom excerpt below), then I get the below
> exceptions...any idea how I can fix this?
>
> Thanks all!
>
>
> C:\mymaven\xcs\xcs-sysinit>mvn -U
> hibernate3:hbm2ddl
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix:
> 'hibernate3'.
> [INFO] org.apache.maven.plugins: checking for updates from
> central
> [INFO] org.codehaus.mojo: checking for updates from central
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building xcs-sysinit
> [INFO] task-segment: [hibernate3:hbm2ddl]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Preparing hibernate3:hbm2ddl
> [INFO] artifact
> org.apache.maven.plugins:maven-resources-plugin: checking
> for updates from central
> [INFO] artifact
> org.apache.maven.plugins:maven-resources-plugin: checking
> for updates from central
> [INFO] artifact
> org.apache.maven.plugins:maven-compiler-plugin: checking for
> updates from central
> [INFO] artifact
> org.apache.maven.plugins:maven-compiler-plugin: checking for
> updates from central
> [INFO] [resources:resources]
> [INFO] Using encoding: 'UTF-8' to copy filtered
> resources.
> [INFO] [hibernate3:hbm2ddl]
> [INFO] src/main/resources/hibernate.cfg.xml not found
> within the project. Trying absolute path.
> [INFO] No hibernate configuration file loaded.
> 22:15:44,995 INFO org.hibernate.cfg.annotations.Version -
> Hibernate Annotations 3.3.0.GA
> 22:15:45,011 INFO org.hibernate.cfg.Environment -
> Hibernate 3.2.5
> 22:15:45,011 INFO org.hibernate.cfg.Environment -
> hibernate.properties not found
> 22:15:45,011 INFO org.hibernate.cfg.Environment - Bytecode
> provider name : cglib
> 22:15:45,027 INFO org.hibernate.cfg.Environment - using
> JDK 1.4 java.sql.Timestamp handling
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NoClassDefFoundError:
> EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap
> at
> org.jboss.util.file.ArchiveBrowser.<clinit>(ArchiveBrowser.java:52)
> at
> org.codehaus.mojo.hibernate3.configuration.AnnotationComponentConfiguration.scanForClasses(AnnotationComponen
> tConfiguration.java:105)
> at
> org.codehaus.mojo.hibernate3.configuration.AnnotationComponentConfiguration.createConfiguration(AnnotationCom
> ponentConfiguration.java:54)
> at
> org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfiguration.getConfiguration(AbstractComponentC
> onfiguration.java:35)
> at
> org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLExporterMojo.java:87)
> at
> org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporterMojo.java:140)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
> a:311)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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: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: 8 seconds
> [INFO] Finished at: Wed Oct 08 22:15:45 PDT 2008
> [INFO] Final Memory: 8M/15M
> [INFO]
> ------------------------------------------------------------------------
>
> ====================================================
> <plugin>
>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.1</version>
> <configuration>
> <verbose>true</verbose>
> <components>
> <component>
>
> <name>hbm2ddl</name>
>
> <implementation>annotationconfiguration</implementation>
> </component>
> <component>
>
> <name>hbm2hbmxml</name>
> </component>
> </components>
> <componentProperties>
> <drop>false</drop>
> <jdk5>true</jdk5>
>
> <scan-jars>true</scan-jars>
>
> <scan-classes>true</scan-classes>
> <!--
>
> <configurationfile>../ecs-services/src/main/resources/ecs.hibernate.cfg.xml</configurationfile>
> -->
> </componentProperties>
> </configuration>
> <dependencies>
> <dependency>
>
> <groupId>mysql</groupId>
>
> <artifactId>mysql</artifactId>
>
> <version>1.0-SNAPSHOT</version>
> </dependency>
> </dependencies>
> </plugin>
>
>
> ====
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email