Hi everybody,
I've just started to learn hibernate, so I follow this
tutorial. I execute this command:
Code:
mvn exec:java -Dexec.mainClass="org.hibernate.tutorial.EventManager" -Dexec.args="store"
and I got this error:
Code:
INFO] [exec:java {execution: default-cli}]
18 [org.hibernate.tutorial.EventManager.main()] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
20 [org.hibernate.tutorial.EventManager.main()] INFO org.hibernate.cfg.Environment - hibernate.properties not found
24 [org.hibernate.tutorial.EventManager.main()] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
29 [org.hibernate.tutorial.EventManager.main()] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
130 [org.hibernate.tutorial.EventManager.main()] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
130 [org.hibernate.tutorial.EventManager.main()] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An exception occured while executing the Java class. null
/hibernate.cfg.xml not found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
build shows that hibernate.cfg.xml file is not found, but in my workspace I have at this path : /classes/org/hibernate/tutorial/domain.
I suppose that I've to add this file to the CLASSPATH, but I don't know how I can do it with mavec-exec plugin.
Thank you in advance for your help.