Hi all,
for some reason the plugin only seems to accept hibernate mapping files that
are
located relative to the src/main/resources directory. As soon as i change
the
outputDirectory of the hbm2hbmxml component/goal to something other than
src/main/resources
the hbm2java goal does not work anymore. is there a way to tell the hbm2java
goal to
use a different resource directory (e.g. src/main/resources/mappings ) ?
could not find
anything about that in the documentation.
I do always get the same error:
[INFO] Configuration XML file loaded:
D:\Eclipse33\DefaultWorkspace\amv-web\src\
main\resources\mappings\hibernate.cfg.xml
13:10:48,343 INFO org.hibernate.cfg.Configuration - configuring from file:
hibe
rnate.cfg.xml
13:10:48,453 INFO org.hibernate.cfg.Configuration - Reading mappings from
resou
rce: de/amites/amv/hbm/Reise.hbm.xml
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] resource: de/amites/amv/hbm/Reise.hbm.xml not found
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.hibernate.MappingNotFoundException: resource:
de/amites/amv/hbm/Reise.hbm.xm
l not found
at
org.hibernate.cfg.Configuration.addResource(Configuration.java:517)
at
org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(Annotat
ionConfiguration.java:524)
at
org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav
a:1479)
at
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
at
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
at
org.hibernate.cfg.Configuration.configure(Configuration.java:1386)
at
org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura
tion.doConfiguration(AbstractComponentConfiguration.java:74)
at
org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura
tion.getConfiguration(AbstractComponentConfiguration.java:37)
at
org.codehaus.mojo.hibernate3.HibernateExporterMojo.configureExporter(
HibernateExporterMojo.java:186)
at
org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.configure
Exporter(Hbm2JavaGeneratorMojo.java:69)
at
org.codehaus.mojo.hibernate3.HibernateExporterMojo.doExecute(Hibernat
eExporterMojo.java:241)
at
org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE
xporterMojo.java:140)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
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)
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)
my plugin configuration looks like :
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-alpha-2</version>
<configuration>
<components>
<component>
<name>hbm2cfgxml</name>
<outputDirectory>src/main/resources/mappings</outputDirectory>
</component>
<component>
<name>hbm2ddl</name>
<implementation>jdbcconfiguration</implementation>
</component>
<component>
<name>hbm2hbmxml</name>
<outputDirectory>src/main/resources/mappings</outputDirectory>
</component>
<component>
<name>hbm2java</name>
<implementation>annotationconfiguration</implementation>
</component>
</components>
<componentProperties>
<propertyfile>/src/main/resources/hbmPluginConfig/database.properties</prope
rtyfile>
<drop>true</drop>
<configurationfile>
/src/main/resources/mappings/hibernate.cfg.xml
</configurationfile>
<jdk5>true</jdk5>
<packagename>de.amites.amv.hbm</packagename>
</componentProperties>
</configuration>
</plugin>
btw. the Web Access link given on the page
http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/source-rep
ository.html
is not valid!
thanks in advance.
cheers,
Andy
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email