0

I am trying to run a Spring Cloud Function on Google Cloud Functions. For that I want to deploy the sample Application on GitHub. I followed the instructions, but when I want to deploy the function, Google says:

Build failed: Building user function from JAR Function directory should contain either a pom.xml or a single *.jar file.

My questions are:

  1. Is this is valid sample project? I can't find any other tutorial.
  2. What am I doing wrong. Is there something else at what should I pay attention?

I know that Java11 is in BETA Phase, but maybe someone could help.

Thanks

Scream
  • 11
  • 1
  • 4
  • Are you able to deploy [this](https://cloud.google.com/functions/docs/first-java) function without issues? If you are able to run the aforementioned quickstart successfully please let me know from where exactly you are issuing the `gcloud function deploy` command, as the error that you are experiencing seems related to the command not being able to find either the pom.xml file or the fat jar in the target/deploy directory (did you run the `mvn package`? – Daniel Ocando Jul 13 '20 at 20:11
  • did you solve it? – Cotrariello Apr 21 '21 at 15:28

1 Answers1

1

I followed all the steps, copied/pasted as described and if worked perfectly.

Try a mvn clean package and deploy again. Maybe an additional JAR exists in the target/deploy directory.

If it continues to not work, paste the command that you run for deploying and the content of your target/deploy directory.

Note: the sample isn't really up to date, because the gcloud command is now in Beta (not only in alpha) and 'whitelist' (allowlist??) is no longer needed

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • Thank you very much, you helped me! I didnt know that beta features have their own component in the Cloud SDK. I tried it only with alpha and without anything. – Scream Jul 14 '20 at 16:44