VAADIN cannot find threads when in productionMode

I have a custom theme for my VAADIN application in src / main / webapp / VAADIN / themes / mytheme / with mytheme.scss and styles.scss files. Everything works fine when the vaadin productionMode deployment option is set to false in web.xml. When I set the parameter to true, suddenly Vaadin cannot find the resources for my theme and continues to complain:

Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder 

I don't have a / WebContent directory, but / webapp instead, since this is a maven web application project. I tried to put the VAADIN folder in:
src / main / resources
src / main / webapp
src / main / webapp / WEB-INF

but nothing works for production mode. Any suggestions? Thank you in advance.

+7
source share
3 answers

You need to add the following target to your pom.xml, which will compile .scss files to .css files:

 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>java</goal> </goals> <configuration> <classpathScope>compile</classpathScope> <mainClass>com.vaadin.sass.SassCompiler</mainClass> <arguments> <argument>src/main/webapp/VAADIN/themes/heijunka/styles.scss</argument> <argument>src/main/webapp/VAADIN/themes/heijunka/styles.css</argument> </arguments> </configuration> </execution> </executions> </plugin> 

Source: http://dev.vaadin.com/ticket/10291

+12
source

@Develman already answered how to fix the problem, but with a bit more explanation.

When the Vaadin application is in development mode, it automatically compiles SCSS -> CSS when styles.css is requested and the file does not exist. In production mode this does not happen. If styles.css exists, regardless of mode, the file is used, and SCSS -> CSS assembly does not exist.

+3
source

I even got this error, although I added the maven target to pom.xml. Finally, I found out the reason because I turned on Vaadin production mode on web.xml. Therefore, when production mode is on, it does not create the styles.css file. Therefore, you need to disable production mode to enable this SCSS β†’ CSS compilation.

 <context-param> <description>Vaadin production mode</description> <param-name>productionMode</param-name> <param-value>false</param-value> </context-param> 
+1
source

All Articles