gpt4 book ai didi

java - GCP 数据流快速入门运行 WordCount 示例时出错 : Unknown lifecycle phase ".mainClass=org.apache.beam.examples.WordCount"

转载 作者:行者123 更新时间:2023-12-01 21:12:27 26 4
gpt4 key购买 nike

我正在尝试从这里开始学习 GCP Cloud Dataflow 的“使用 Java 快速入门”https://cloud.google.com/dataflow/docs/quickstarts/quickstart-java-maven我在“本地运行 WordCount”步骤中收到错误。

在 PowerShell 提示符下运行此命令

PS C:\apache-maven-3.6.2\word-count-beam> mvn 编译 exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount -Dexec.args="- -output=.\output\"

我收到一条构建失败消息:

[ERROR] Unknown lifecycle phase ".mainClass=org.apache.beam.examples.WordCount". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

当我添加 -e 时,我还得到了堆栈跟踪:

at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:248) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:217) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144) at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:97) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:111) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

我正在使用 jdk-13.0.1 和 maven 3.6.2,并设置了 JAVA_HOME 并将 JAVA_HOME\Bin 和 Maven 添加到我的 PATH 中。

知道出了什么问题吗?

最佳答案

如果您使用的是 powershell,请使用“-D exec.mainClass”而不是“-Dexec.mainClass”

关于java - GCP 数据流快速入门运行 WordCount 示例时出错 : Unknown lifecycle phase ".mainClass=org.apache.beam.examples.WordCount",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58897681/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com