Fix java8 template to support resources#86
Conversation
|
it works for me, thanks ! |
|
Great :) |
|
What is the impact on the build time before/after? |
With this change all resources within function's `src/main/resources` will be added to function.jar. Before that they used to be omited. The distribution, created after `gradle build` was modifying the jars, excluding all resources. Fixed that by deleting this distribution and creating a controlled one with `gradle distZip` Signed-off-by: Ivana Yovcheva (VMware) <iyovcheva@vmware.com>
c98eb6d to
27b2e10
Compare
|
Build time before: After: I've updated the description with test for reading resource contents. |
|
@alexellis are you likely to merge this anytime soon? |
|
@ivanayov Is this still applicable? I am unable to duplicate the issue with the java8 template pulled as of this morning (21 Feb 2019). I followed your test procedure and was able to find the resource and load the content of the file without the changes suggested in this PR. |
|
@tessellator When I run the current template, it does not find resources, I wrote functions to lists all files etc and it never found them |
|
Hmm, that is really weird. Here are the changes I made to the sample function to list the file contents, and I get the following output: Would you mind trying my version of the function and seeing what you get (repo link)? I just want to establish some common ground for debugging purposes. |
|
@tessellator @burf2000 please could you both test and report back? |
|
Hi @erlendv, please could you take a quick look at this? Alex |
|
Im not able to reproduce this using the latest templates. Resources are included in the built jar-file. |
With this change all resources within function's
src/main/resourceswill be added to function.jar.Before that they used to be omited.
The distribution, created after
gradle buildwas modifying the jars, excluding all resoursed.Fixed that by deleting this distribution and creating a controlled one with
gradle distZipSigned-off-by: Ivana Yovcheva (VMware) iyovcheva@vmware.com
Motivation and Context
Which issue(s) this PR fixes
Fixes #72
How Has This Been Tested?
Tested function from @spacedoudou with updated template:
http://github.com/spacedoudou/openfaas1
Fixed code in Handler.java to prefix resource file with
/:After modifying code to read contents:
Types of changes
Checklist:
git commit -s