简体   繁体   English

Spring-Boot 应用程序构建不正确

[英]Spring-Boot application does not build properly

my problem is when I trying to run my spring-boot project via STS or simple JavaApplication the changes after the last maven build are not built.我的问题是当我尝试通过 STS 或简单的 JavaApplication 运行我的 spring-boot 项目时,未构建上次 maven 构建后的更改。

I'm tried several methods but, if I don't use maven build the project changes are not rebuilt.我尝试了几种方法,但是,如果我不使用 maven build,则不会重建项目更改。

Do you have any tips, what's wrong?你有什么提示吗,有什么问题吗?

In the Project menu Build Automatically is selected.在 Project 菜单 Build Automatically 被选中。 And the main method is annotated with @SpringBootApplication并且main方法用@SpringBootApplication注解

(The hot-swap is not working too for me.) (热插拔对我来说也不起作用。)

I think .我认为 。 do clean first then right click project Maven-> update Maven.先清理,然后右键单击项目 Maven-> 更新 Maven。 do clean again.再次清洁。 plz求求你了

I found the solution.我找到了解决方案。 In the .project file for my project I simply added a javabuilder build command.在我的项目的.project文件中,我只是添加了一个javabuilder build 命令。 After that STS works perfectly and rebuilds the project before start.之后 STS 完美运行并在开始之前重建项目。 I think this problem occurs because I created a maven project, instead of creating a java project and convert it to a maven project.我认为出现这个问题是因为我创建了一个maven项目,而不是创建了一个java项目并将其转换为一个maven项目。

If your project is gradle then go to Project right click and go to >gradle >Refresh gradle project.如果您的项目是 gradle,则转到 Project 右键单击​​并转到 >gradle >Refresh gradle 项目。

Try to click ctrl +shift+O for import realated dependencies in your project.尝试单击 ctrl +shift+O 以在项目中导入相关的依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM