title: Apache CXF codegen plugin throws nullpointer
body: <p>I'm using maven to generate code from a wsdl contract, but when the goal generate-sources is executed I get a nullpointer in WSDL2JavaMojo. It seems like the method processWsdl is trying to use a reference (outputDir), which is null. By can't understand why have this nullpointer problem, my pom-file looks okay to me.</p>
  
  <p>If I change the version of the codegen plugin to 2.2.1 I still get the error but the code is generated, so I can copy it from target/generated-sources to another location. But I want to avoid my build failures.</p>
  
  <p>Here is my pom and stacktrace, thanks.</p>
  
  <p>Olle</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/maven-v4_0_0.xsd"&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
   &lt;groupId&gt;example.ws&lt;/groupId&gt;
   &lt;artifactId&gt;ws-test&lt;/artifactId&gt;
   &lt;version&gt;ws-test-1.0&lt;/version&gt;
  
   &lt;dependencies&gt;
    &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
              &lt;version&gt;2.1.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
              &lt;version&gt;2.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
    &lt;dependency&gt;
     &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
     &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
     &lt;version&gt;1.5.2&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
     &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
     &lt;version&gt;1.5.2&lt;/version&gt;
    &lt;/dependency&gt;
  
   &lt;/dependencies&gt;
   &lt;build&gt;
    &lt;plugins&gt;
     &lt;plugin&gt;
      &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
      &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2.1&lt;/version&gt;
      &lt;executions&gt;
       &lt;execution&gt;
        &lt;id&gt;generate-sources&lt;/id&gt;
        &lt;phase&gt;generate-sources&lt;/phase&gt;
        &lt;configuration&gt; 
         &lt;sourceRoot&gt;${basedir}/target/generated-sources/&lt;/sourceRoot&gt;
         &lt;wsdlOptions&gt;
          &lt;wsdlOption&gt;
           &lt;wsdl&gt;${basedir}/src/main/java/Weather.wsdl&lt;/wsdl&gt;
           &lt;extraargs&gt;
            &lt;extraarg&gt;-client&lt;/extraarg&gt;
            &lt;extraarg&gt;-verbose&lt;/extraarg&gt; 
           &lt;/extraargs&gt;          
          &lt;/wsdlOption&gt;
         &lt;/wsdlOptions&gt;
        &lt;/configuration&gt;
        &lt;goals&gt;
         &lt;goal&gt;wsdl2java&lt;/goal&gt;
        &lt;/goals&gt;
       &lt;/execution&gt;
      &lt;/executions&gt;    
     &lt;/plugin&gt;
     &lt;plugin&gt;
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
       &lt;descriptorRefs&gt;
        &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
       &lt;/descriptorRefs&gt;
      &lt;/configuration&gt;
     &lt;/plugin&gt;
     &lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
       &lt;execution&gt;
        &lt;id&gt;add-source&lt;/id&gt;
        &lt;phase&gt;generate-sources&lt;/phase&gt;
        &lt;goals&gt;
         &lt;goal&gt;add-source&lt;/goal&gt;
        &lt;/goals&gt;
        &lt;configuration&gt;
         &lt;sources&gt;
          &lt;source&gt;${basedir}/target/generated-sources&lt;/source&gt;
         &lt;/sources&gt;
        &lt;/configuration&gt;
       &lt;/execution&gt;
      &lt;/executions&gt;
     &lt;/plugin&gt;
  
    &lt;/plugins&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;configuration&gt;
        &lt;source&gt;1.5&lt;/source&gt;
        &lt;target&gt;1.5&lt;/target&gt;
       &lt;/configuration&gt;
      &lt;/plugin&gt;
     &lt;/plugins&gt;
    &lt;/pluginManagement&gt;
   &lt;/build&gt;
  </code></pre>
  
  <h2>    </h2>
  
  <pre><code>    [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.2.1:wsdl2java (generate-sources) on project ws-test: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.2.1:wsdl2java failed. NullPointerException -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.2.1:wsdl2java (generate-sources) on project ws-test: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.2.1:wsdl2java failed.
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:593)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   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.PluginExecutionException: Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.2.1:wsdl2java failed.
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:114)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
   ... 14 more
  Caused by: java.lang.NullPointerException
   at org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:297)
   at org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:257)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
   ... 15 more
  [ERROR] 
  </code></pre>