X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=dist%2Fthymeleaf%2Fblog%2Farticle.html;fp=dist%2Fthymeleaf%2Fblog%2Farticle.html;h=f5d6b58bf31dcad444bca145d995dd4df965dad5;hb=7a44df939822a58bfa2438cca372a624724c60aa;hp=2873911fc029b716121c71b6df11e42f5ed64d0e;hpb=7991acb8dcde417b83e4fbcca18fe4c52d610c4c;p=website diff --git a/dist/thymeleaf/blog/article.html b/dist/thymeleaf/blog/article.html index 2873911f..f5d6b58b 100644 --- a/dist/thymeleaf/blog/article.html +++ b/dist/thymeleaf/blog/article.html @@ -9,9 +9,9 @@ juplo - blog - Combining jetty-maven-plugin and wro4j-maven-plugin for Dynamic Reloading of LESS-Resources - - - + + + @@ -50,11 +50,11 @@ <groups xmlns="http://www.isdc.ro/wro"> <group name="base"> - <css>/less/base/*.css</css> + <css>/css/base/*.css</css> </group> -

wro4j looks for /less/base/*.css inside the root of the web-context, which is equal to src/main/webapp in a normal maven-project. There are other ways to specifie the resources, which enable you to store them elswhere. But this approach works best for our goal, because the path is understandable for both: the wro4j servlet-filter, we are configuring now for our development-environment, and the wro4j-maven-plugin, that we will configure later for build-time compilation.

+

wro4j looks for /css/base/*.css inside the root of the web-context, which is equal to src/main/webapp in a normal maven-project. There are other ways to specifie the resources, which enable you to store them elswhere. But this approach works best for our goal, because the path is understandable for both: the wro4j servlet-filter, we are configuring now for our development-environment, and the wro4j-maven-plugin, that we will configure later for build-time compilation.

wro.properties

wro.properties in short tells wro4j, how or if it should convert the combined sources and how it should behave. I am using the following configuration to tell wro4j, that it should convert *.css-sources into CSS and do that on every request:

@@ -205,7 +205,7 @@
   
           

The filter processes any URI’s that end with .css. This way, the wro4j servlet-filter makes base.css available under any path, because for exampl /base.css, /css/base.css and /foo/bar/base.css all end with .css.

-

This is all, that is needed to develop with dynamically reloadable compiled LESS-resources. Just fire up your browser and browse to /what/you/like/base.css. (But do not forget to put some LESS-files in src/main/webapp/less/base/ first!)

+

This is all, that is needed to develop with dynamically reloadable compiled LESS-resources. Just fire up your browser and browse to /what/you/like/base.css. (But do not forget to put some LESS-files in src/main/webapp/css/base/ first!)

Step 3: Install wro4j-maven-plugin

All that is left over to configure now, is the build-process. If you would build and deploy your webapp now, the CSS-file base.css would not be generated and the link to your stylesheet, that already works in our jetty-maven-plugin environment would point to a 404. Hence, we need to set up the wro4j-maven-plugin. I am using this configuration:

@@ -253,7 +253,7 @@
           

We only scrached the surface, of what can be done with wro4j. Based on this configuration, you can easily enable additional features to fine-tune your final build for maximum speed. You really should take a look at the list of available Processors!