How do I resolve java.lang.NoSuchMethodError: com.google.api.services.dataflow.model.Environment.setSdkPipelineOptions with Google Cloud Dataflow?

时间:2016-07-11 22:52:20

标签: google-cloud-dataflow

I copied the MinimalWordCount example.

I also copied all the dependencies from pom.xml. When I run it with

mvn compile exec:java -Dexec.mainClass=com.example.MyExample

it compiles, but I get java.lang.NoSuchMethodError: com.google.api.services.dataflow.model.Environment.setSdkPipelineOptions with the stacktrace pointing to the p.run() line.

1 个答案:

答案 0 :(得分:2)

In addition to the dependencies, you need to add the Google Cloud Dataflow parent pom.

<parent>
  <groupId>com.google.cloud.dataflow</groupId>
  <artifactId>google-cloud-dataflow-java-sdk-parent</artifactId>
  <version>1.6.0</version>
</parent>