添加jtwig后intellij将不会构建项目

时间:2017-04-13 22:38:54

标签: java spring intellij-idea spring-boot jtwig

我使用Spring Initilizer使用intelliJ IDEA设置了Spring Boot。一切都很好,直到我想添加Jtwig。一旦我这样做,即使从pom.xml中删除它也不会再构建

我的pom.xml:

find()

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0

inComment

这是我添加的部分:

<?xml version="1.0" encoding="UTF-8"?>

这是错误日志:

<groupId>net.myapp</groupId>
<artifactId>myapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>myapp</name>
<description>myapp</description>

<repositories>
    <repository>
        <id>jcenter</id>
        <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.2.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

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

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-cache</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.session</groupId>
        <artifactId>spring-session</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jtwig</groupId>
        <artifactId>jtwig-spring-boot-starter</artifactId>
        <version>5.85.3.RELEASE</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

这是MyApp.java / Main class

<repositories>
    <repository>
        <id>jcenter</id>
        <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>

<dependency>
        <groupId>org.jtwig</groupId>
        <artifactId>jtwig-spring-boot-starter</artifactId>
        <version>5.85.3.RELEASE</version>
    </dependency>

1 个答案:

答案 0 :(得分:0)

重新导入/重新加载maven项目。这应该重置依赖项。

但你应该查看依赖树... jtwig可能带来了一个旧的servlet依赖。

如果是这样,你必须将它从pom中排除。

https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html