Problem Description:
Enter the Simple-webapp directory to run
MVN HIBERNATE3:HBM2DDL
Report the following error
[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:2.1:hbm2ddl (DEFAULT-CLI) on project Simple-webapp: Could not get configurationtask. → [help 1]
My environment is as follows:
Jdk1.7,maven V3.3.1
C:\users\xiaopan\simple-parent-spring\simple-parent\simple-webapp>mvn-vapache Maven 3.3.1 ( cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-14t04:10:27+08:00) Maven home:c:\developtools\maven\bin\. Java version:1.7.0_40, vendor:oracle corporationjava home:c:\home\jdk\jdk 1.7.40\jredefault locale:zh_cn, Platform Enc Oding:gbkos Name: "Windows 7", Version: "6.1", Arch: "AMD64", Family: "Windows"
Cause of Error:
According to Http://stackoverflow.com/questions/23270551/maven-by-example-nullpointer-executing-hibernate3hbm2ddl's answer, According to the content of the answer can be obtained is jdk1.7 version caused, need to downgrade to 1.6
Problem Description:
So I downgraded the JDK to 1.6, and there was another error.
Exception in thread "main" java.lang.unsupportedclassversionerror:org/apache/maven/cli/mavencli:unsupported Major.minor version 51.0 at Java.lang.ClassLoader.defineClass1 (Native Method) at Java.lang.ClassLoader.defin Eclasscond (classloader.java:631) ...
Cause of Error:
It looks like the JDK version was wrong, so Google checked, according to http://stackoverflow.com/questions/29255495/ Maven-installation-osx-error-unsupported-major-minor-version-51-0 's answer and the https://jira.codehaus.org/browse/in the answer MNG-5780 links can be drawn:
Maven has a minimum of 1.7 versions of the JDK after the V3.3.1 version, and I am now downgrading to version 1.6, so the error
Solution:
Downgrade maven to V3.2.5 version
Post-downgrade environment variables are as follows jdk1.6, maven V3.2.5
C:\users\xiaopan>mvn-vapache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15t01:29:23+08:00) Maven home:c:\developtools\maven\bin\. Java version:1.6.0_38, Vendor:sun Microsystems Inc.java home:c:\home\jdk\jdk 1.6.38\jredefault LOCALE:ZH_CN, platform Encoding:gbkos Name: "Windows 7", Version: "6.1", Arch: "AMD64", Family: "Windows"
Enter Simple-webapp rerun MVN hibernate3:hbm2ddl,
Success!
Maven authoritative guide 7.7 uses Hibernate3 plugin to construct database error