Spring Boot: Replace config.js for Webapps-Configuration


#1

Hi all

I have the same problem, which was not solved in Spring Boot + WebApps + Localization + Customization. In a nutshell: I cannot override the config.js for the Webapps (app/tasklist/scripts/config.js for example).

I read the following ressources:

  1. Internationalization in the Camunda BPM Tasklist
  2. Configuration
  3. provide example with static web resources/customized cockpit

I tried several combinations. These are my findings so far:

  1. I’m able to serve a static resource (config.js for example), if I put it in a sub-folder of /src/main/resources/static as long as this folder is not called “app”.
  2. So, for instance, putting config.js in /src/main/resources/static/test, I can browse it by http://localhost:8080/test/config.js.
  3. As soon as I try to serve any resource (not only existing ones like config.js) in /src/main/resources/static/app or a subfolder of it, I can’t browse this resource, even though it gets in the correct target directory, building the application.

What is the reason for these findings?


Spring Boot + WebApps + Localization + Customization
#2

Hi @scepbjoern,

I just uploaded a snippet to our snippet section that showcases how to customize the Camunda Webapps when using spring-boot: https://github.com/camunda-consulting/code/tree/master/snippets/springboot-customized-webapps

Actually, replacing the config.js is included in that snippet.

Best,
Ragnar


#3

Hi @Ragnar

Wow! Thank you very much for your work, which is highly apreciated. I never thought, that customizing the Webapps is so much more complicate with Spring Boot than without. Because most of the time, life is so much easier with Spring Boot, but not in this case.

But with your “snippets” and the explanations in the ReadMe, it worked as it should as you can see in the attached image.

Kind regards
Björn


#5

I was able to override files in the camunda 7.9.0 webjar, simply by putting them into src/main/resources/META-INF/resources. In there I have app/tasklist/scripts/config.js and it overrides the one from the webjar.

image

From 7.10.0 the layout has changed, use src/main/resources/webjars/camunda/app. You can find out where spring-boot is searching for resources by debugging org.springframework.web.servlet.resource.PathResourceResolver#getResource(), look at the incoming locations.