title: Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
body: <p>I am trying to run a basic hibernate 5 program using maven. It gives error while creating the Configuration object. What am I missing ? Getting the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
      at org.spade.utility.HibernateUtility.getSessionFactory(HibernateUtility.java:15)
      at org.spade.dao.UserDao.saveUser(UserDao.java:21)
      at org.spade.dao.UserDao.main(UserDao.java:12)
  Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 3 more
  </code></pre>
  
  <p>This is the pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;org.spade&lt;/groupId&gt;
    &lt;artifactId&gt;HibernateDemo&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
    &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                  &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
                  &lt;version&gt;5.2.10.Final&lt;/version&gt;
              &lt;/dependency&gt;
  
              &lt;dependency&gt;
                  &lt;groupId&gt;com.github.noraui&lt;/groupId&gt;
                  &lt;artifactId&gt;ojdbc7&lt;/artifactId&gt;
                  &lt;version&gt;12.1.0.2&lt;/version&gt;
              &lt;/dependency&gt;
    &lt;/dependencies&gt;
  
    &lt;build&gt;
    &lt;pluginManagement&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.6.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Following are the jars present as Maven dependencies:
  <a href="https://i.stack.imgur.com/7Rso1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Rso1.png" alt="enter image description here"></a></p>
  
  <p>I have seen other answers on SO giving solution for the same problem but none has worked.</p>