Mount of delegate code on classpath through .jar files

Camunda Platform Run 7.18.
To use org.camunda.bpm.engine.delegate.JavaDelegate in my code, I simply create a Maven dependency on org.camunda.bpm in my project. Of course, my “delegate code” class, say my_package.My_delegate_class is set in my BPMN model to be used at runtime (BPMN model instance startup).
I understand that I have to install my built .jar file under configuration/userlib so that the .jar file is mounted at Camunda Platform startup? Right? Is it a “good” practice?
However, my .jar file has a lot of (expected) direct or transitive dependencies (I count 22!). I fear I also have to install all of them under configuration/userlib while org.camunda.bpm.engine.delegate.JavaDelegate is JUST A SIMPLE interface? I mean, a lot of code is mounted while it is useless?
Sorry about about this question from dude/dummy, but I have the hindering feeling that I miss something…

Hi @Bab64,

If you want to (or have to) use Java delegates for service task implementation, it is much easier to use the camunda-bpm-spring-boot-starter to spin up your project: Get started with Camunda and the Spring Boot | docs.camunda.org

If you want to (or have to) keep Camunda Run, packaging is much easier if you use an external task worker to implement your service tasks: Executing automated steps (2/6) | docs.camunda.org

Hope this helps, Ingo

1 Like

Hi Ingo. Many thanks about your help and… Merry Christmas and HNY in advance… I’ve used workers for external tasks (as well). This works fine until now… This is not the issue of my question.
In fact, I want to experience all aspects of Camunda BPMN for my customer. To that extent, “Java delegate” is greatly discussed in the CAMUNDA doc. as a first-class option. That’s the reason why I look for an end-to-end answer about “Java delegate”, namely the way of using external libraries in my Java (delegate) code.
To sum up, do I have to put all my .jar stuff under configuration/userlib including dependencies? Or does it exist a better practice. Thanks.

Hi @Bab64,

You may be successful putting a jar with delegates into configuration/userlib. I haven’t ever tested it, and Camunda RUN is not designed to run JavaDelegates.

It’s easier to develop and package if you start your java projects with Maven/Gradle and the camunda-bpm-spring-boot-starter dependencies.

Hope this helps, Ingo

Many thanks Ingo (thread closed). This works fine, ie, putting .jar files under /configuration/userlib. These .jar files are Java “delegate” code (“delegate” being a CAMUNDA concept) and needed libraries. For instance, I’ve tried digital signature libraries. I’ve configured MAVEN to copy all .jar files and dependencies directly in /configuration/userlib.
The problem is that the tutorial (Get started with Camunda | docs.camunda.org) is based on CAMUNDA platform RUN, so readers expect end-to-end explanations. The tutorial has many “implicits” about Java/Maven issues and thus hard to put into practice. Many thanks to Camunda people that are both friendly and great experts.