Closed kameshchauhan closed 4 years ago
Hi Kamesh this sounds like a fair request to me. Thank you for working on your first OpenFaaS PR.
Please can you give me a quick example of how it works and a repo where you have used it?
I'd like to see an example where you have a dependency pulled in from jcenter and another one where you have a local jar that is being bundled as a dependency such as okhttp.
My initial thoughts were that this should be maintained in a separate repo, but subject to the above working I think perhaps we should have it in the official templates repo.
:+1:
Alex
Hi, I've a few comments here, having multiple build tools, will mean that we will start seeing lots of forks of the same code and it will become hard to maintain imho. For example, the same sub modules:
model
entrypoint
are now duplicated so if there is a bug or improvement changes, they must be duplicated in the 2 places. Why not push these 2 modules as maven dependencies to maven central which means that they can be referred as a jar dependency regardless of the build tool (maven or gradle)?
It will also simplify the build as there's less code to compile and projects are simpler (just a single module instead of a multi module project).
Another thing is that the maven project (if I read it correctly does not configure any repos, so it means it only pulls dependencies from maven central and the readme refers to jcenter).
Local jars are not really an issue, maven has the concept of system dependencies:
<dependency>
<groupId>com.sshx</groupId>
<artifactId>sshx</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/sshxcute-1.0.jar</systemPath>
</dependency>
Where you can refer to project base file references.
If we want to avoid pushing stuff to maven central, then it should be a matter of testing if we can use symbolic links, then we would just keep one source of java files and distinct project files...
I totally agree with your suggestion. Those common projects should be on maven central. This will also potential solve the below existing problems:
About the use of local repo in maven template is work under progress.
I think this is related to the changes I suggested #137. If the interfaces in model were published to jCenter or maven-central, you could use whatever build tool you wanted for development of this. It might requires a few changes to how the Docker Builder works, but I don't think it would be too hard.
Let's agree on below:
@alexellis I have submitted a claim of repository in Central Maven via Nexus. In order approver repository starting with com.openfaas.*, we need to prove that domain is owned by submitter. Please read comment and help resolve in the JIRA issue at : https://issues.sonatype.org/browse/OSSRH-47615
I suggest to avoid reflection for 3, and instead use ServiceLoader
s, the reason is if one would prefer to build a native image, reflection will require manual configuration while service loaders won't. Also when moving to a module world (java >=9) reflection might be blocked if a module does not allow access to a specific class.
Closing this issue in favour of - https://github.com/openfaas/templates/issues/210
I haven't seen a lot of acitivty on this from the community, but I am pressing ahead with it this week and would welcome your input and contributions.
Currently Java8 template does not support Maven as build system. As a developer, I should be able to create OpenFaaS function using java that uses Maven as build system. I have created a java8-maven template to do the same. The template is forked from the main repo openfaas/templates into my repository here: https://github.com/kameshchauhan/templates/tree/master/template/java8-maven
@pmlopes Please review and share your comments.