This project(module) is generate by org.apache.servicecomb.archetypes:business-service-spring-boot2-starter-archetype, it use java-chassis-spring-boot-starter-standalone to develop service producer.
Under project(module) root folder, run
mvn package
Then you can get executable jar in target/bin folder:
java -jar xxxxxx-{version}-exec.jar
Notice: If you need to modify config setting in “microservice.yaml” like service center address but don't want repackage the executable jar, you can direct place a new “microservice.yaml” file in same folder, then settings will be overridden.
Spring Boot can accelerate develop speed of Spring application, it provides these features:
Using Spring Boot in microservice development, can greatly simplifying configure and deploy. ServiceComb is a microservice framework with full functionality of service management, focus on rapidly development of microservices, so integration with Spring Boot can obtain greater advantages.
Developers often use Spring Boot2 in the following way:
java-chassis-spring-boot-starter-standalone
and set web-application-type: none
in application.yaml then develop general application, does not contain WEBjava-chassis-spring-boot-starter-servlet
then develop web application, also include an embedded Tomcat or Jetty server, and use Spring Web MVC framework to develop REST endpointsThe first way, do not need any refactoring, directly startup ServiceComb via Spring Boot.
The second way is replace Spring MVC DispatcherServlet
with ServiceComb RestServlet
.