GUJ Discussões   :   últimos tópicos   |   categorias   |   GUJ Respostas

Thymeleaf não baixa com o Maven

Tags: #<Tag:0x00007f3bd4f70f00> #<Tag:0x00007f3bd4f70dc0> #<Tag:0x00007f3bd4f70c80> #<Tag:0x00007f3bd4f70b18>

Boa tarde Pessoal,
Estou tentando baixar oThymeleaf via maven, mas o mesmo não baixa.
Estou usando netbeans, mas também tentei fazer a operação via Eclipse.

Segue o meu Pom.xml

<modelVersion>4.0.0</modelVersion>

<groupId>com.algaworks</groupId>
<artifactId>brewer</artifactId>
<version>1.0.0-SNAPSHOT</version>

<packaging>war</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <failOnMissingWebXml>false</failOnMissingWebXml>

    <java.version>1.8</java.version>
    <maven-compiler-pluging.version>3.2</maven-compiler-pluging.version>

    <!-- Spring MVC -->
    <spring-framework.version>4.3.0.RELEASE</spring-framework.version>

    <!-- Servlet API -->
    <servlet.version>3.1.0</servlet.version>
	
    <!-- Thymeleaf -->
    <thymeleaf.version>3.0.0.RELEASE</thymeleaf.version>
</properties>


<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-pluging.version}</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>${spring-framework.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <!-- Spring MVC -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>

    <!-- Servlet API -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>${servlet.version}</version>
        <scope>provided</scope>
    </dependency>

    <!-- Thymeleaf -->
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
       
    </dependency>

    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring5</artifactId>
      
    </dependency>

</dependencies>

Tenta adicionar no seu pom conforme alguma versão da central: link

Tentei, mas mesmo assim não deu certo. Inclusive tentei fazer com as versoes mais atualizadas do Thymeleaf e do Spring.
Quando retiro o Thymeleaf do codigo, ai não há erro…

<modelVersion>4.0.0</modelVersion>

<groupId>com.algaworks</groupId>
<artifactId>brewer</artifactId>
<version>1.0.0-SNAPSHOT</version>

<packaging>war</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <failOnMissingWebXml>false</failOnMissingWebXml>

    <java.version>1.8</java.version>
    <maven-compiler-pluging.version>3.2</maven-compiler-pluging.version>

    <!-- Spring MVC -->
    <spring-framework.version>5.2.7.RELEASE</spring-framework.version>

    <!-- Servlet API -->
    <servlet.version>3.1.0</servlet.version>
	
    <!-- Thymeleaf -->
    <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
</properties>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-pluging.version}</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>${spring-framework.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <!-- Spring MVC -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>

    <!-- Servlet API -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>${servlet.version}</version>
        <scope>provided</scope>
    </dependency>
 
    <!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf -->
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>
    
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring5</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>

</dependencies>

Pessoal,
Consegui resolver alterando as versoes do Thymeleaf
Obrigado @Jakecoll

Segue como ficou:

<modelVersion>4.0.0</modelVersion>
<groupId>com.algaworks</groupId>
<artifactId>brewer</artifactId>
<version>1.0.0-SNAPSHOT</version>

<packaging>war</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <failOnMissingWebXml>false</failOnMissingWebXml>

    <java.version>1.8</java.version>
    <maven-compiler-pluging.version>3.2</maven-compiler-pluging.version>
    <!-- Spring MVC -->
    <spring-framework.version>5.2.7.RELEASE</spring-framework.version>
    <!-- Servlet API -->
    <servlet.version>3.1.0</servlet.version>

    <!-- Thymeleaf -->
    <thymeleaf.version>3.0.10.RELEASE</thymeleaf.version>
</properties>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-pluging.version}</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>${spring-framework.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <!-- Spring MVC -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>

    <!-- Servlet API -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>${servlet.version}</version>
        <scope>provided</scope>
    </dependency>
 
    <!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf -->
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf-spring5 -->
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring5</artifactId>
        <version>${thymeleaf.version}</version>
    </dependency>

</dependencies>
1 Curtida
//