title: How to debug Dataflow/Apache Beam pipeline DoFn functions in eclipse using direct runner
body: <p>I want to run my pipeline using <a href="https://beam.apache.org/documentation/runners/direct/" rel="nofollow noreferrer">direct runner</a> in eclipse and put a break point in my DoFn functions and debug execution. I tried to setup direct runner with following steps:</p>
  
  <ol>
  <li>Add direct runner maven package<a href="https://i.stack.imgur.com/aZLHc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aZLHc.jpg" alt="enter image description here"></a></li>
  <li>Setup maven profile for direct runner in pom.xml. My pom.xml has <a href="https://pastebin.com/19vW4bXM" rel="nofollow noreferrer">this profile</a></li>
  </ol>
  
  <p><code>
  &lt;profiles&gt;
     &lt;profile&gt;
        &lt;id&gt;direct-runner&lt;/id&gt;
        &lt;activation&gt;
           &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
        &lt;/activation&gt;
        &lt;dependencies&gt;
           &lt;dependency&gt;
              &lt;groupId&gt;org.apache.beam&lt;/groupId&gt;
              &lt;artifactId&gt;beam-runners-direct-java&lt;/artifactId&gt;
              &lt;version&gt;0.2.0-incubating&lt;/version&gt;
           &lt;/dependency&gt;
        &lt;/dependencies&gt;
     &lt;/profile&gt;
  &lt;/profiles&gt;</code></p>
  
  <ol start="3">
  <li>I have <a href="https://pastebin.com/PunzJKHi" rel="nofollow noreferrer">this</a> maven plugin under plugin management in my pom.xml</li>
  </ol>
  
  <p><code>&lt;pluginManagement&gt;
        &lt;plugins&gt;
          &lt;plugin&gt;
            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
            &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;1.4.0&lt;/version&gt;
            &lt;executions&gt;
              &lt;execution&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;java&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
            &lt;configuration&gt;
              &lt;cleanupDaemonThreads&gt;false&lt;/cleanupDaemonThreads&gt;
              &lt;mainClass&gt;com.MyMainClass&lt;/mainClass&gt;
            &lt;/configuration&gt;
          &lt;/plugin&gt;
        &lt;/plugins&gt;
      &lt;/pluginManagement&gt;</code></p>
  
  <ol start="4">
  <li>Below is a screen shot of my eclipse debug configuration<a href="https://i.stack.imgur.com/sjX2v.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sjX2v.jpg" alt="enter image description here"></a> 
  When I run using above debug configuration job starts in GCP dataflow instead of local JVM threads and my breakpoints are never hit.</li>
  </ol>