I am trying to generate entities using hbm2java using maven. However I get this error, It is quiet evident that postgres driver jar is missing but its present in the maven repository. Setting the dependency scope as runtime too did not solve the problem.
I've added the dependency under hibernate3-maven-plugin. What am I missing ?
Which goal are you running for the hibernate plugin?
Anyway, I suspect that the issue has to do with the <scope> - I doubt that the hibernate goal is running as part of a phase that uses runtime scope. You should either remove the scope for the postgresql dependency, or change it to 'compile'. If that doesn't work, try moving the dependency to the project's dependency list.
Runtime dependencies are only added into test classpath. Maven doesn't add it to the compile classpath. Compile time plugins look at compile classpath.
You can do 1 of 2 things
a) Set the scope to of postgre driver to provided. This will include the jar in compile and and test, but the jar won't be packaged
b) You can add a dependency tag to a plugin to add a dependency just for that plugin. So, you can add a dependency to postgre driver inside the hibernate3-maven-plugin