我已经阅读了有关spring boot dev工具的内容,并想尝试一下,我将以下内容添加到我的pom中
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
并打开devtools重新启动Net beans选项中的手动触发器。要运行我在运行项目 - >执行目标中使用以下选项org.springframework.boot:spring-boot-maven-plugin:1.3.2.RELEASE:run
但是当我在代码中更改smth时,项目不会重新运行。我错过了什么?
单击项目属性 - >构建 - >编译是一个勾选的“编译保存”复选框。通过修改.java文件并检查/ target / classes中的时间戳来验证这实际上是有效的。
此外,通过将Netbeans项目属性中的“运行项目操作”中的“执行”目标更改为以下内容:
process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
将显式资源目录位置(在我的情况下为src / main / resources)配置为pom.xml可以解决不重新加载的问题:
<build>
...
<resources>
<resource>
<directory> src/main/resources </directory>
</resource>
</resources>
...
</build>