百里香叶升级到版本 3 不适用于百里香叶布局方言 1.3.2



我正在尝试将百里香叶升级到版本 3,但不幸的是它不适用于布局方言。有什么解决方案可以让我工作吗?

谢谢

    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
        <version>3.0.0.BETA01</version>
    </dependency>
    <dependency>
        <groupId>nz.net.ultraq.thymeleaf</groupId>
        <artifactId>thymeleaf-layout-dialect</artifactId>
        <version>1.3.2</version>
    </dependency>
Caused by: java.lang.NoClassDefFoundError: org/thymeleaf/dom/Attribute
at nz.net.ultraq.thymeleaf.LayoutDialect.<clinit>(LayoutDialect.groovy:49) ~[thymeleaf-layout-dialect-1.3.2.jar:na]

Dialect API 已针对 Thymeleaf 3 进行了重写。 它仍处于测试阶段,并非所有方言都已迁移。

"...在此阶段,并非所有百里香叶方言都已迁移到百里香叶3,因此如果您使用某些外部方言,它们可能无法与百里香叶3一起使用。请检查所需的方言是否具有Thymeleaf 3兼容版本。(http://www.thymeleaf.org/doc/articles/thymeleaf3migration.html(

似乎兼容版本正在取得进展:https://github.com/ultraq/thymeleaf-layout-dialect/tree/dev

它不在Maven Central上,所以,如果你想试一试,你需要自己克隆和构建它,或者使用 https://jitpack.io/来获取它。 如果使用抖动包,请添加

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>nz.net.ultraq.thymeleaf</groupId>
    <artifactId>thymeleaf-layout-dialect</artifactId>
    <version>dev-SNAPSHOT</version>
</dependency>

我没有测试该配置,但它应该很接近。

显然,这是一个正在开发的快照版本,您应该仔细考虑是否在生产系统中使用它。

最新更新