无法在春季启动时使用autorestart工作

时间:2016-10-28 03:06:23

标签: spring spring-boot spring-tool-suite

我正在尝试一个来自spring boot样本github repo(https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-jersey)的spring-jersey示例项目。 更改java文件后,服​​务器未重新启动。 IDE = STS 3.8.0.RELEASE。我看过教程,只提到下面的依赖为他们工作。但它不适合我

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

的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bonzai</groupId>
<artifactId>boot</artifactId>
<version>2.0</version>
<packaging>jar</packaging>

<name>Spring-Jersey-maven</name>
<description>DemoProject</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.1.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-devtools</artifactId>           
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jersey</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-undertow</artifactId>
        <scope>provided</scope>
    </dependency>
    <!-- <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</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-configuration-processor</artifactId>
    </dependency>

</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork>
            </configuration>
        </plugin>
    </plugins>
</build>

我用不同的方式运行应用程序

  1. mvn spring-boot:从命令行运行
  2. 以java应用程序运行
  3. 作为春季启动应用运行
  4. 但是在java代码更改后,它们都没有触发重启。

0 个答案:

没有答案