camunda-community-hub / micronaut-camunda-platform-7

Integration between Micronaut and Camunda (Workflow Engine). We configure Camunda with sensible defaults, so that you can get started with minimum configuration: simply add a dependency in your Micronaut project to embed the workflow engine!
https://camunda.com/blog/2021/07/automate-any-process-on-micronaut/
Apache License 2.0
75 stars 31 forks source link

How to properly add Cockpit plugins? #411

Open datakurre opened 2 years ago

datakurre commented 2 years ago

What is the right way to include UI plugins for Camunda Cockpit (and other apps) in a Micronaut Camunda app?

Last time I tried, I ended up copying whole "resources/META-INF" from camunda webapp jar and added plugins into the mix. I recall that once I added resources/META-INF into the app, it did override the resource directory from webapp jar.

https://github.com/datakurre/carrot-rcc/tree/main/nix/pkgs/camunda-platform/src/main/resources/META-INF

I am not "native" in Java development, so I might be just missing something.

tobiasschaefer commented 2 years ago

Hi @datakurre ,

I've actually never created a UI plugin for Camunda so I need some time to research your request.

datakurre commented 2 years ago

Hi @tobiasschaefer,

it's mainly about how those static resource files are packaged and discovered in Java. And that's something what has been hard for me to google, because Java is not my first language.

In Camunda Spring Boot, it's enough to add the overriding and additional files into apps "META-INF" like at https://gitlab.com/atsoukka/robot-rpa-playground/-/tree/master/camunda/app/src/main/resources/META-INF

It will somehow fallback/cascade its lookup into Camund webapps jar so that both custom and default resources are being served.

But with Camunda micronaut the behavior is different. When "META-INF" exists on app, it no longer looks files from camunda webapps jar.

So, I was able to make it work by copying everything into apps "META-INF". But was left wondering that there must be better way.

lwluc commented 2 years ago

Hey @datakurre, @tobiasschaefer,

I took a quick look and I think these lines maybe need to be changed. I was not able to test it yet, what do you think @tobiasschaefer?

tobiasschaefer commented 1 year ago

I stumbled across https://github.com/micronaut-projects/micronaut-servlet/issues/114 which might be related.