Hi All,
I wonder if I’m doing something wrong here. I’ve successfully created a sample java project from the template and deployed it and it all looks good.
But when I try to deploy only one function with “serverless deploy function --function hello”, rather taking the jar file from the target folder it tries to zip up the whole folder and uploads (I’ve checked it by downloading the package with “export function”)
When I deploy the whole project with “serverless deploy” it takes the jar and deploys it and works fine, but when I use “deploy function” it fails with class not found.
Have you also updated your service definition to include the relevant packaging options? Because Serverless works with many languages, it doesn’t currently automatically work-out language-specific dependencies, packages, etc. It will be a difficult problem to solve consistently, especially if (when!) more languages are supported.
Once you specify individually: true in your serverless.yml and the various specific includes/excludes for your funciton, I think your targeted deploy command will work as you expect. As I haven’t personally tested it with Java, please report back and let us know if it does or doesn’t work.
Hi, thanks for quick reply.
It worked when I moved the artefact property to function definition rather than global and set individually to true. So this is working
I don’t want to define the package in each of my function definitions. But I would still love to deploy individual function from my local in the development phase.