title: Apache Beam: Cannot find DataflowRunner
body: <p>I am trying to run a pipeline, which I was able to run successfully with <code>DirectRunner</code>, on Google Cloud Dataflow. When I execute this Maven command:</p>
  
  <pre><code>mvn compile exec:java \
      -Dexec.mainClass=com.example.Pipeline \
      -Dexec.args="--project=project-name \
      --stagingLocation=gs://bucket-name/staging/ \
      ... custom arguments ...
      --runner=DataflowRunner"
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>No Runner was specified and the DirectRunner was not found on the classpath.
  [ERROR] Specify a runner by either:
  [ERROR]     Explicitly specifying a runner by providing the 'runner' property
  [ERROR]     Adding the DirectRunner to the classpath
  [ERROR]     Calling 'PipelineOptions.setRunner(PipelineRunner)' directly
  </code></pre>
  
  <p>I intentionally removed <code>DirectRunner</code> from my <code>pom.xml</code> and added this:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;
      &lt;artifactId&gt;beam-runners-google-cloud-dataflow-java&lt;/artifactId&gt;
      &lt;version&gt;2.0.0&lt;/version&gt;
      &lt;scope&gt;runtime&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I went ahead and removed the <code>&lt;scope&gt;</code> tag, then called <code>options.setRunner(DataflowRunner.class)</code>, but it didn't help. Extending my own <code>PipelineOptions</code> interface from <code>DataflowPipelineOptions</code> did not solve the problem as well.</p>
  
  <p>Looks like it ignores <code>runner</code> option in a way I am not able to debug.</p>
  
  <p><em>Update</em>: Here is the full <code>pom.xml</code>, in case that helps:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;dataflow&lt;/artifactId&gt;
      &lt;version&gt;0.1&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;
              &lt;artifactId&gt;beam-sdks-java-core&lt;/artifactId&gt;
              &lt;version&gt;2.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;
              &lt;artifactId&gt;beam-runners-google-cloud-dataflow-java&lt;/artifactId&gt;
              &lt;version&gt;2.0.0&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;
              &lt;artifactId&gt;beam-sdks-java-io-jdbc&lt;/artifactId&gt;
              &lt;version&gt;2.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;
              &lt;artifactId&gt;beam-sdks-java-io-google-cloud-platform&lt;/artifactId&gt;
              &lt;version&gt;2.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;42.1.4.jre7&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>