functions-framework-java
functions-framework-java copied to clipboard
deploy with maven plugin hangs forever the first time
Console log looks as follows:
[INFO] ------------------------< co.worklytics:project >-------------------------
[INFO] Building project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- function-maven-plugin:0.9.7:deploy (default-cli) @ project ---
Executing Cloud SDK command: gcloud functions deploy project-google-chat --trigger-http --entry-point=co.worklytics.project.Route --service-account=project-google-chat-dwd@project-dev-erik.iam.gserviceaccount.com --env-vars-file=./configs/google-chat.yaml --runtime=java11 --project=project-dev-erik
This is invoked by IntelliJ "Run Configuration".
When I go to terminal and run gcloud functions deploy project-google-chat --trigger-http --entry-point=co.worklytics.project.Route --service-account=project-google-chat-dwd@project-dev-erik.iam.gserviceaccount.com --env-vars-file=./configs/google-chat.yaml --runtime=java11 --project=project-dev-erik
then I get the prompt
Allow unauthenticated invocations of new function [project-google-chat]?
(y/N)?
I answer 'N' to that, and everything continues as expected. If I now try the IntelliJ
run configuration again, it all works.
I'd blame IntelliJ
for not picking up the prompt, yet I tried against having added allowUnauthenticated
explicitly to my pom.xml
, and the same behavior happens:
<groupId>com.google.cloud.functions</groupId>
<artifactId>function-maven-plugin</artifactId>
<version>0.9.7</version>
<configuration>
<functionTarget>co.worklytics.project.Route</functionTarget>
<envVarsFile>./configs/${sourceApi}.yaml</envVarsFile>
<projectId>${gcpProjectId}</projectId>
<name>project-${sourceApi}</name>
<serviceAccount>${serviceAccount}</serviceAccount>
<allowUnauthenticated>false</allowUnauthenticated>
</configuration>