Using the asset pipline in Grails, the production CSS and Javascript files have been including with a digest appendix. This feature is not available in Spring Boot, therefore I started to create a simple Thymeleaf tag library.

The tag library simply contains two tag attribute processors with shared code to enable an automatic rewrite of src and href attributes:


<html xmlns:asset="">
<script asset:src="@{/assets/main.js}"></script>
<link asset:href="@{/assets/main.css}" rel="stylesheet"/>

The asset:src="@{/assets/main.js}" will be replaced with src="/assets/main-DIGEST.js".

If the developmentRuntime is enabled and no exists or the contains no entry for a given file, the URL is not modified.

Required dependency

compile 'ch.itds.taglib:asset-pipeline-thymeleaf-taglib:1.0.0'

Required configuration

public class ThymeleafConfig {
    public AssetDialect assetDialect() {
        return new AssetDialect();

The source is available on GitHub in itds-ch/asset-pipeline-thymeleaf-taglib

Latest release: