title: Maven throws nullpointer exception
body: <p>Good day,</p>
  
  <p>I have built a project using maven. Throughout this project, I have concluded that one more dependency has to be added for a particular module. I have added this dependency in it's pom file and when I have tried to rebuild the project using maven, a null pointer was thrown.</p>
  
  <p>Pom files before:</p>
  
  <p>(child pom:)
          </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>(main pom:)</p>
  
  <pre><code>    &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.solveit.crm.core&lt;/groupId&gt;
              &lt;artifactId&gt;crm-core&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt; //this dependency is for another module, it was
                          declared at the start of the project
  
  
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>Pom files now(which cause nullpointer):</p>
  
  <p>(child pom:)</p>
  
  <pre><code>&lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.solveit.crm.data&lt;/groupId&gt;
          &lt;artifactId&gt;crm-data&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>(main pom:)</p>
  
  <pre><code>&lt;dependencyManagement&gt;
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.0-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.solveit.crm.core&lt;/groupId&gt;
              &lt;artifactId&gt;crm-core&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.solveit.crm.data&lt;/groupId&gt;
              &lt;artifactId&gt;crm-data&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>Why does maven throw null pointer exception? I am confused right now.</p>
  
  <p>ERROR MESSAGE: </p>
  
  <pre><code>    [INFO] Scanning for projects...
  [ERROR] Internal error: java.lang.NullPointerException -&gt; [Help 1]
  org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerEx
  ception
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:483)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
  cher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
  a:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
  uncher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
  356)
  Caused by: java.lang.NullPointerException
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:270)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
          ... 11 more
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
  ch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please rea
  d the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorE
  xception
  </code></pre>
  
  <p>In eclipse I get:</p>
  
  <pre><code>    [INFO] Scanning for projects...
  [ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.solveit.crm.data:crm-data:1'}' and 'Vertex{label='com.solveit.crm.core:crm-core:1'}' introduces to cycle in the graph com.solveit.crm.core:crm-core:1 --&gt; com.solveit.crm.data:crm-data:1 --&gt; com.solveit.crm.core:crm-core:1 -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectCycleException
  </code></pre>
  
  <p>Thank you </p>