How do I run a spring boot executable jar in a Production environment?

后端 未结 9 2138
一向
一向 2020-12-02 04:19

Spring boot\'s preferred deployment method is via a executable jar file which contains tomcat inside.

It is started with a simple java -jar myapp.jar.

9条回答
  •  隐瞒了意图╮
    2020-12-02 04:55

    This is a simple, you can use spring boot maven plugin to finish your code deploy.

    the plugin config like:

    
                    org.springframework.boot
                    spring-boot-maven-plugin
                    
                        -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${debug.port}
                        
                        
                            test
                        
                        true
                    
                
    

    And, the jvmArtuments is add for you jvm. profiles will choose a profile to start your app. executable can make your app driectly run.

    and if you add mvnw to your project, or you have a maven enveriment. You can just call./mvnw spring-boot:run for mvnw or mvn spring-boot:run for maven.

提交回复
热议问题