hibernate3-maven-plugin error (A required class is missing)

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown hibernate3-maven-plugin error (A required class is missing)

by dahoffer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Using hibernate3-maven-plugin v2.2 executing the hibernate3:hbm2hbmxml goal I get the following error.  It can't find the ExporterMogo class.

What may be causing this?

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.codehaus.mojo:hi
bernate3-maven-plugin:2.2:hbm2hbmxml': Unable to load the mojo 'org.codehaus.moj
o:hibernate3-maven-plugin:2.2:hbm2hbmxml' in the plugin 'org.codehaus.mojo:hiber
nate3-maven-plugin'. A required class is missing: org/codehaus/mojo/hibernate3/E
xporterMojo
org.codehaus.mojo.hibernate3.ExporterMojo


BTW, I was using hibernate 3.2.7.ga but I upgraded to 3.3.2.ga but that didn't help. 

Do I need to add something to get this class?

-Dave


Re: hibernate3-maven-plugin error (A required class is missing)

by jcstaff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I hit this same error only when building from a parent pom project (with a DAO sibling project) and an empty local maven repository. Building from the leaf DAO project worked each time. Building from the parent pom project would always work the second and subsequent times once the repository was partially loaded. I thought for a while that the issue might have been caused by my use of profiles; hibernate definitions were separate from the schema generation. However, adding the hibernate jars and the one that it actually complained about did not work. The error originally occurred when I had version=2.0 and changing to version=2.2 had no impact.

The final fix was to add extensions=true to the plugin declaration.

    <artifactId>hibernate3-maven-plugin</artifactId>
    <groupId>org.codehaus.mojo</groupId>
    <version>2.2</version>
    <extensions>true</extensions>

Reading the pom.xml documentation, I am assuming this is opening the plugin to a more broadly defined classpath. Although this allows it to work the first and every time. The extension=true does not seem like it should have been necessary if it works the second and subsequent times.