Google cloud dataflow 谷歌云数据流上的apachebeam

Google cloud dataflow 谷歌云数据流上的apachebeam,google-cloud-dataflow,Google Cloud Dataflow,我正试图在谷歌云数据流上运行一个作业,但无法让部署工作。使用DirectRunner作业可以正常运行,但一旦切换到dataflow runner,就会出现以下异常: [WARNING] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccesso

我正试图在谷歌云数据流上运行一个作业,但无法让部署工作。使用DirectRunner作业可以正常运行,但一旦切换到dataflow runner,就会出现以下异常:

[WARNING]
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: No Runner was specified and the DirectRunner was not found on the classpath.
Specify a runner by either:
    Explicitly specifying a runner by providing the 'runner' property
    Adding the DirectRunner to the classpath
    Calling 'PipelineOptions.setRunner(PipelineRunner)' directly
        at org.apache.beam.sdk.options.PipelineOptions$DirectRunner.create(PipelineOptions.java:286)
        at org.apache.beam.sdk.options.PipelineOptions$DirectRunner.create(PipelineOptions.java:276)
        at org.apache.beam.sdk.options.ProxyInvocationHandler.returnDefaultHelper(ProxyInvocationHandler.java:575)
        at org.apache.beam.sdk.options.ProxyInvocationHandler.getDefault(ProxyInvocationHandler.java:516)
        at org.apache.beam.sdk.options.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:155)
        at org.apache.beam.sdk.options.PipelineOptionsValidator.validate(PipelineOptionsValidator.java:70)
        at org.apache.beam.sdk.runners.PipelineRunner.fromOptions(PipelineRunner.java:44)
        at org.apache.beam.sdk.Pipeline.create(Pipeline.java:138)
        at my.package.SalesTransactions.main(SalesTransactions.java:218)
我要运行的命令:

mvn compile exec:java -Dexec.mainClass=my.package.SalesTransactions -Dexec.args="--runner=DataflowRunner --project=my-project --tempLocation=gs://my-project/tmp" -Pdataflow-runner

我发现了我的错误。从DirectRunner切换到DataFlowRunner时,我必须在pom.xml中添加依赖项,而不是将其作为概要文件运行时依赖项

<dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
      <version>${beam.version}</version>
    </dependency>

org.apache.beam
谷歌云数据流java
${beam.version}

您可以共享您的pom.xml吗?或者确认您已经在Dataflow runner上添加了依赖项吗?我已经添加了一个pom.xml摘录,显示了使用的maven配置文件。