Процесс IntelliJ завершен с кодом выхода 0, когда spring -boot run

У меня проблема при запуске spring -boot appication от IntelliJ-Idea. У меня нет этой проблемы при запуске приложения через терминал.

:: Spring Boot ::        (v1.2.1.RELEASE)

2015-09-24 12:22:44.274  WARN 22380 --- [           main] n.sf.ehcache.config.CacheConfiguration   : Cache 'publicationsCount' is set to eternal but also has TTI/TTL set.  To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'publicationsCount' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.

Process finished with exit code 0

Я думаю, что это предупреждение не вызывает этого. В чем может быть причина?

Ответы

Ответ 1

Удаление предоставленной области spring -boot-starter-tomcat зависимостей помогает мне.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

Ответ 2

Добавьте следующие зависимости в pom.xml:

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <scope>test</scope>
        </dependency>

Ответ 3

У меня просто была такая же проблема. Ни одна из зависимостей, таких как spring-boot-starter-web или удаление зависимости spring-boot-starter-tomcat, не работала. Я использовал версию сообщества IntelliJ Idea IDE. Я думаю, что это как-то связано с версией IntelliJ Idea Community, так как они упоминают, что Spring не поддерживается в версии сообщества, только в окончательной (коммерческой) версии, по крайней мере, для Mac.

https://www.jetbrains.com/idea/download/#section=mac

Причина моего размышления, потому что я переключился на Visual Studio Code, установил необходимые плагины для весенней загрузки, и это сработало из коробки с моим существующим файлом pom.xml.

Мои текущие зависимости:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

Может быть стоит упомянуть, что также работает без зависимости spring-boot-starter-tomcat.