Closed s1monw1 closed 3 years ago
I can just agree here. Creating a Java OpenFaas function can be improved regarding developer experience.
In my opinion, AWS Java lambda is easy to use for creating custom Java functions, for details have a look at https://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-handler-types.html
I started publishing the dependencies to jcenter but ran into issues with all of the admin requirements and JIRA system. I will bump it up on the list to review again.
Both the java8 and java12 template consist of multiple Gradle modules:
function
,entrypoint
andmodel
with bothfunction
andentrypoint
pulling a localproject
dependency ofmodel
.If used via
faas-cli
, the generated code (everything fromfunction
) cannot be compiled since themodel
dependency is not resolvable (since it is not being generated as part of the user-facing template). This submodule needs to be decoupled and made available as a remote dependency.Expected Behaviour
If I generate a function based on a template via
faas-cli
, I expect to get a project I can build without seeing any compilation issues.Current Behaviour
Using java8 and java12, the generated function cannot be built due to compilation errors (unresolved dependency to
model
)Possible Solution
I propose the following solution:
model
has to live in a separate repo, let's sayopenfaas/java-template-model
and a tag/release needs to be created (e.g. 1.0.0)maven
plugin has to be added to themodel
moduleentrypoint
andfunction
have to addmaven { url 'https://jitpack.io' }
as a repository in thebuild.gradle
plus declaring a dependencyimplementation 'com.github.openfaas:java-template-mode:1.0.0'
git submodule
to the actual template so that it is still obvious that themodel
is part of the template itself.Your Environment