使用mvn命令部署数据流模板时出错



你好,我正在运行下面的代码来部署GCP中的数据流模板。

mvn compile exec:java 
-Dexec.mainClass=com.google.cloud.teleport.templates.TextIOToBigQuery 
-Dexec.cleanupDaemonThreads=false 
[-Dexec.args="--runner=DataflowRunner 
--project=$PROJECT_ID 
--stagingLocation=gs://bucket/staging 
--tempLocation=gs://bucket/temp 
--templateLocation=gs://bucket/templates/writeToBQ.json 
--region=$DEV_REGION
"] 
-P dataflow-runner

但是我一直得到下面的错误…我不确定为什么要把参数作为文件?我只能假设我的命令格式是错误的…任何想法吗?

Downloading from central: https://repo.maven.apache.org/maven2/%20%5B-Dexec/args=--runner=DataflowRunner%20%5C%20--project=project%20%5C%20--stagingLocation=gs///bucket/staging%20%5C%20--tempLocation=gs///bucket/temp%20%5C%20--templateLocation=gs///bucket/staging%20%5C%20--tempLocation=gs-//bucket/temp%20%5C%20--templateLocation=gs.pom
[WARNING] The POM for  [-Dexec.args=--runner=DataflowRunner  --project=Project  --stagingLocation=gs://bucket/staging  --tempLocation=gs:jar://bucket/temp  --templateLocation=gs is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/%20%5B-Dexec/args=--runner=DataflowRunner%20%5C%20--project=project%20%5C%20--stagingLocation=gs///bucket/temp%20%5C%20--templateLocation=gs.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:16 min
[INFO] Finished at: 2022-04-27T09:47:03Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin  [-Dexec.args=--runner=DataflowRunner  --project=project  --stagingLocation=gs://bucket/staging  --tempLocation=gs://bucket/temp  --templateLocation=gs or one of its dependencies could not be resolved: Could not find artifact  [-Dexec.args=--runner=DataflowRunner  --project=project  --stagingLocation=gs://bucket/staging  --tempLocation=gs:jar://bucket/temp  --templateLocation=gs in central (https://repo.maven.apache.org/maven2) -> [Help 1]

你能试着从命令中去掉方括号吗?在这里可以找到一个例子。

mvn compile exec:java 
-Dexec.mainClass=com.example.myclass 
-Dexec.args="--runner=DataflowRunner 
--project=PROJECT_ID 
--stagingLocation=gs://BUCKET_NAME/staging 
--templateLocation=gs://BUCKET_NAME/templates/TEMPLATE_NAME 
--region=REGION" 
-P dataflow-runner

最新更新