ultraq / thymeleaf-layout-dialect

A dialect for Thymeleaf that lets you build layouts and reusable templates in order to improve code reuse

Home Page:https://ultraq.github.io/thymeleaf-layout-dialect/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot compile anymore when importing LayoutDialect because Groovy is missing

sguillope opened this issue · comments

Hello, when upgrading from 2.4.1 to 2.5.0, we are getting a compiler failure:

Kotlin: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class nz.net.ultraq.thymeleaf.LayoutDialect, unresolved supertypes: groovy.lang.GroovyObject

We use Maven and when upgrading, the transitive dependency on org.codehaus.groovy:groovy changed from compile to runtime. We instantiate LayoutDialect in our code and so it requires Groovy to be in the compile scope.

I suspect the issue stems from the change in 6a616a4 which effectively changes the way transitive dependencies are exposed.

For now our workaround is to include org.codehaus.groovy:groovy as a direct compile dependency of our project.

Weird, Gradle docs say the implementation is pretty much the new compile. I'll definitely have to look into it and the generated pom - thanks for raising this!

EDIT: Yup, that commit you referenced made all the dependencies as runtime in the generated POM file 🤦‍♂️ Expect a patch release to resolve this soon.

I've just hit the release button on a 2.5.1 version to Maven Central that looks to generate a POM with the right scope (compile) for the dependencies, so that should be rolling out very soon after I post this. Once you update to 2.5.1, you should be able to remove your workaround.

Nice thanks for the quick turnaround, that did for us 👍
Cheers!