needed help with maven overlay for customizing valo theme

Hi,
I’m using a multi module maven project create with vaadin archetype

myproject
myproject-ui
myproject-widgetset
myproject-production

I use
production
profile to overlay some files of myproject-ui and create a customized war
mvn -P
production
package

I’ve tried to overlay some .scss in myproject-production, for example variables.sccs that contains some changes to valo theme
but they are not considered into theme re-compilation


file1

./myproject-ui/src/main/webapp/VAADIN/themes/mytheme/variables.sccs


file2

./myproject-production/src/main/webapp/VAADIN/themes/mytheme/​variables.sccs

I want overlay file1 with file2 and build a different theme when I use
production
profle

regards

Hi,
I’ve never tried to do something like this, but I would start from the myproject-production pom.xml artifactItem configurations for maven-dependency-plugin. I suspect your war has been configured there to include the theme from its own project package, while you’d want to forget about that theme altogether and include the theme from your myproject-production project. Or maybe only that one class? Regardless, you need to exclude the parts you don’t want and include the parts you do want. Not entirely sure how to do the pointing to a different module in that case, though. I have this kind of redirects in my liferay-maven-plugin settings in my myproject-widgetset pom.xml: ${basedir}/../myproject-ui , but in your case the configuration starts with VAADIN/themes/ etc. instead of project root so it might not work quite the same

Another option could be to create a new myproject-uiproduction module where you extend your UI class and set the production theme for it.

Thank you for reply.
I think I do not need to create an extra ui since I want to change only a .scss and keep same theme name.
If I change this file taken from myproject-production before theme compile, I’ll have a war with a custom theme.

maven is instructed to copy files

from
${basedir}/myproject-ui/src/main/webapp/VAADIN/themes/mytheme/

to
${basedir}/myproject-production/target/mytheme/VAADIN/themes/mytheme
and to compile mytheme to be included in war

I’m not a maven expert, I would know if it is possible to change a file in
${basedir}/myproject-production/target/mytheme/VAADIN/themes/mytheme before compile-theme task