在服务器上运行Spring Boot应用程序

时间:2019-03-15 11:22:55

标签: java spring spring-boot tomcat

我是Spring应用程序开发的新手。

在tomcat服务器的开发阶段如何运行我的应用程序。

here我可以看到最终部署的解决方案。每当我需要停止并重新启动时,我只需要在ui上进行一些更改。它杀死了我。那你能帮我吗??

我的pom.xml依赖项是

                  org.springframework         弹簧绑定         1.0.6     

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

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</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-thymeleaf</artifactId>
</dependency>

2 个答案:

答案 0 :(得分:1)

将devtools依赖项添加到您的项目中。

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

只要文件在类路径中发生更改,使用spring-boot-devtools的应用程序都会导致应用程序重新启动。此功能的好处是大大减少了验证所做更改所需的时间。

答案 1 :(得分:0)

使用maven install gol创建应用程序,生成jar,然后使用> java -jar your_jar.jar

在服务器上运行jar
相关问题