spring-attic / spring-cloud-gcp

Integration for Google Cloud Platform APIs with Spring
Apache License 2.0
705 stars 693 forks source link

Access a library in gitlab maven repo from a cloud function #2490

Closed Tritpi closed 3 years ago

Tritpi commented 4 years ago

Im trying to access a custom library deployed in gitlab maven repo in a java cloud function. I have added the location to the gitlab repo path inside the repository tag in pom.xml and the dependency is also in pom.xml. There is a settings.xml added with a token to access the gitlab repo. But still it fails to download the library.

Please confirm if this can be done and if so whether the approach I'm following is correct or not.

meltsufin commented 4 years ago

I don't think this question belongs in this repo. Maybe it would be more appropriate to ask here. One thing to consider is that you can just build the jar for GCF locally and deploy it without relying on the build happening on the server.

cc/ @eamonnmcmanus

Tritpi commented 4 years ago

When uploading the jar file directly it gives the following error:

Build failed: function has neither pom.xml nor already-built jar file; directory has these entries: .googlebuild, BOOT-INF, META-INF, org; Error ID: 438702a3

meltsufin commented 4 years ago

Based on the error message, it appears that what you're uploading is not a jar file. In any case, please try following the instructions found here.

Tritpi commented 4 years ago

Tried the steps given in the link above. The fat jar(has the dependencies from the private gitlab maven repo) did get created in the target/deploy folder but when the gcloud command was ran to deploy it the following error was thrown:

Function failed to load user code.

meltsufin commented 4 years ago

@Tritpi Would mind trying to run the sample, and then we can debug from there? Thanks!

meltsufin commented 3 years ago

Closing due to inactivity from OP.