title: NullPointerException when switching from hibernate-maven-plugin version 2.2 to version 3.0
body: <p>I am updating the versions of my pom.xml dependencies and I've run into a vague error when I change the version of the hibernate3-maven-plugin from</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;!-- Run "mvn hibernate3:hbm2ddl" to generate schema --&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate3-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2&lt;/version&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;!-- Run "mvn hibernate3:hbm2ddl" to generate schema --&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate3-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.0&lt;/version&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>With version 2.2, everything compiles successfully, and</p>
  
  <pre><code>mvn hibernate3:hbm2ddl
  </code></pre>
  
  <p>creates the correct schema from annotated classes.</p>
  
  <p>Changing nothing else but the version results in the following error when I run the hbm2ddl command again:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project myProject: There was an error creating the AntRun task. NullPointerException -&gt; [Help 1]
  </code></pre>
  
  <p>The full stack trace is as follows:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project myProject: There was an error creating the AntRun task. NullPointerException -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:hibernate3-maven-plugin:3.0:hbm2ddl (default-cli) on project myProject: There was an error creating the AntRun task.
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.MojoExecutionException: There was an error creating the AntRun task.
      at org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:84)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more
  Caused by: java.lang.NullPointerException
      at org.codehaus.plexus.configuration.DefaultPlexusConfiguration.add(DefaultPlexusConfiguration.java:174)
      at org.codehaus.plexus.configuration.DefaultPlexusConfiguration.addChild(DefaultPlexusConfiguration.java:150)
      at org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.setHibernateConfiguration(PlexusConfigurationUtils.java:289)
      at org.codehaus.mojo.hibernate3.util.PlexusConfigurationUtils.parseHibernateTool(PlexusConfigurationUtils.java:67)
      at org.codehaus.mojo.hibernate3.AbstractHibernateToolMojo.getConfiguration(AbstractHibernateToolMojo.java:60)
      at org.codehaus.mojo.hibernate3.AbstractHibernateMojo.execute(AbstractHibernateMojo.java:76)
      ... 21 more
  </code></pre>
  
  <p>If I go back to version 2.2, everything works fine. And because I am not looking to upgrade for any particular reason other than simply having the most up-to-date dependencies, I'll stick with 2.2 for the time being.</p>
  
  <p>Hopefully someone can shed some light on this!</p>