以前都只知道使用IDE啟動SpringBoot,或者只用Tomcat跑專案,但從來沒有試過其他的方法,這次來了解還有什麼方式可以啟動
- Package project to
.jar
and Usejava
command - Package project to
.war
and depoly to tomcat - Change disk to project-root and Use
mvn
command - Use IDE Run
- Use Spring Boot Cli
Use Java
Change disk to project root path
➜ 3.6.0 cd ~/Documents/springbootdocker
➜ springbootdocker ls
./ .gitignore .mvn/ mvnw* pom.xml src/
../ .idea/ HELP.md mvnw.cmd springbootdocker.iml target/
Package project
➜ springbootdocker mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< pri.anc:springbootdocker >----------------------
[INFO] Building springbootdocker 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ springbootdocker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ springbootdocker ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/alan/Documents/springbootdocker/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ springbootdocker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/alan/Documents/springbootdocker/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ springbootdocker ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/alan/Documents/springbootdocker/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ springbootdocker ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.22.1/surefire-junit4-2.22.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.22.1/surefire-junit4-2.22.1.pom (3.1 kB at 1.9 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.22.1/surefire-providers-2.22.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.22.1/surefire-providers-2.22.1.pom (2.5 kB at 6.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.22.1/surefire-junit4-2.22.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.22.1/surefire-junit4-2.22.1.jar (85 kB at 108 kB/s)
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running pri.anc.springbootdocker.SpringbootdockerApplicationTests
14:47:43.837 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:43.858 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
14:47:43.878 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
14:47:43.924 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
14:47:43.974 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests], using SpringBootContextLoader
14:47:43.987 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]: class path resource [pri/anc/springbootdocker/SpringbootdockerApplicationTests-context.xml] does not exist
14:47:43.988 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]: class path resource [pri/anc/springbootdocker/SpringbootdockerApplicationTestsContext.groovy] does not exist
14:47:43.988 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.
14:47:43.991 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]: SpringbootdockerApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
14:47:44.157 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.392 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [/Users/alan/Documents/springbootdocker/target/classes/pri/anc/springbootdocker/SpringbootdockerApplication.class]
14:47:44.407 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration pri.anc.springbootdocker.SpringbootdockerApplication for test class pri.anc.springbootdocker.SpringbootdockerApplicationTests
14:47:44.591 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]: using defaults.
14:47:44.594 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
14:47:44.665 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@55b7a4e0, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@5f058f00, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@192d43ce, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@72057ecf, org.springframework.test.context.support.DirtiesContextTestExecutionListener@1afd44cb, org.springframework.test.context.transaction.TransactionalTestExecutionListener@6973b51b, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@1ab3a8c8, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@43195e57, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@333291e3, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@479d31f3, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@40ef3420, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@498d318c]
14:47:44.675 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.676 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.679 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.679 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.683 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.684 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.693 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@323b36e0 testClass = SpringbootdockerApplicationTests, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@44ebcd03 testClass = SpringbootdockerApplicationTests, locations = '{}', classes = '{class pri.anc.springbootdocker.SpringbootdockerApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@2d6eabae, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@10bbd20a, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@e320068, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@78e67e0a], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null].
14:47:44.697 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.697 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [pri.anc.springbootdocker.SpringbootdockerApplicationTests]
14:47:44.731 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true, server.port=-1}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
2019-03-30 14:47:45.397 INFO 83642 --- [ main] p.a.s.SpringbootdockerApplicationTests : Starting SpringbootdockerApplicationTests on smartcaredeMacBook-Air.local with PID 83642 (started by alan in /Users/alan/Documents/springbootdocker)
2019-03-30 14:47:45.399 INFO 83642 --- [ main] p.a.s.SpringbootdockerApplicationTests : No active profile set, falling back to default profiles: default
2019-03-30 14:47:47.960 INFO 83642 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.hateoas.config.HateoasConfiguration' of type [org.springframework.hateoas.config.HateoasConfiguration$$EnhancerBySpringCGLIB$$a9cec29e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-03-30 14:47:49.739 INFO 83642 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-03-30 14:47:50.598 INFO 83642 --- [ main] p.a.s.SpringbootdockerApplicationTests : Started SpringbootdockerApplicationTests in 5.827 seconds (JVM running for 7.617)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.957 s - in pri.anc.springbootdocker.SpringbootdockerApplicationTests
2019-03-30 14:47:51.455 INFO 83642 --- [ Thread-3] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ springbootdocker ---
[INFO] Building jar: /Users/alan/Documents/springbootdocker/target/springbootdocker-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) @ springbootdocker ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.615 s
[INFO] Finished at: 2019-03-30T14:47:54+08:00
[INFO] ------------------------------------------------------------------------
Package finished, Check “.jar” is exist?
➜ springbootdocker cd target
➜ target ls
./ generated-test-sources/ springbootdocker-0.0.1-SNAPSHOT.jar.original
../ maven-archiver/ surefire-reports/
classes/ maven-status/ test-classes/
generated-sources/ springbootdocker-0.0.1-SNAPSHOT.jar
Use Java -jar Command start project
➜ target java -jar springbootdocker-0.0.1-SNAPSHOT.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
2019-03-30 14:56:06.356 INFO 83687 --- [ main] p.a.s.SpringbootdockerApplication : Starting SpringbootdockerApplication v0.0.1-SNAPSHOT on smartcaredeMacBook-Air.local with PID 83687 (/Users/alan/Documents/springbootdocker/target/springbootdocker-0.0.1-SNAPSHOT.jar started by alan in /Users/alan/Documents/springbootdocker/target)
2019-03-30 14:56:06.362 INFO 83687 --- [ main] p.a.s.SpringbootdockerApplication : No active profile set, falling back to default profiles: default
2019-03-30 14:56:08.511 INFO 83687 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.hateoas.config.HateoasConfiguration' of type [org.springframework.hateoas.config.HateoasConfiguration$$EnhancerBySpringCGLIB$$c15508fa] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-03-30 14:56:09.280 INFO 83687 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-03-30 14:56:09.342 INFO 83687 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-03-30 14:56:09.342 INFO 83687 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
2019-03-30 14:56:09.363 INFO 83687 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/alan/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2019-03-30 14:56:09.517 INFO 83687 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-03-30 14:56:09.517 INFO 83687 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3028 ms
2019-03-30 14:56:10.977 INFO 83687 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-03-30 14:56:11.692 INFO 83687 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-03-30 14:56:11.699 INFO 83687 --- [ main] p.a.s.SpringbootdockerApplication : Started SpringbootdockerApplication in 6.251 seconds (JVM running for 7.037)
Use Tomcat
Required start tomcat server
$ cp target/projectName.jar ${CATALINA_HOME}/webapps
$ open "http://localhost:8080/projectName"
Use Maven
Change disk to project root path
➜ springbootdocker mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< pri.anc:springbootdocker >----------------------
[INFO] Building springbootdocker 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) > test-compile @ springbootdocker >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ springbootdocker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ springbootdocker ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ springbootdocker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/alan/Documents/springbootdocker/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ springbootdocker ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) < test-compile @ springbootdocker <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) @ springbootdocker ---
[INFO] Attaching agents: []
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
2019-03-31 02:23:15.509 INFO 84476 --- [ restartedMain] p.a.s.SpringbootdockerApplication : Starting SpringbootdockerApplication on smartcaredeMacBook-Air.local with PID 84476 (/Users/alan/Documents/springbootdocker/target/classes started by alan in /Users/alan/Documents/springbootdocker)
2019-03-31 02:23:15.519 INFO 84476 --- [ restartedMain] p.a.s.SpringbootdockerApplication : No active profile set, falling back to default profiles: default
2019-03-31 02:23:15.788 INFO 84476 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-03-31 02:23:15.789 INFO 84476 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-03-31 02:23:19.934 INFO 84476 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.hateoas.config.HateoasConfiguration' of type [org.springframework.hateoas.config.HateoasConfiguration$$EnhancerBySpringCGLIB$$e46a1a0e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-03-31 02:23:21.824 INFO 84476 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-03-31 02:23:21.957 INFO 84476 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-03-31 02:23:21.961 INFO 84476 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
2019-03-31 02:23:22.023 INFO 84476 --- [ restartedMain] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/alan/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2019-03-31 02:23:22.358 INFO 84476 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-03-31 02:23:22.359 INFO 84476 --- [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 6569 ms
2019-03-31 02:23:24.862 INFO 84476 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-03-31 02:23:26.244 INFO 84476 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2019-03-31 02:23:26.527 INFO 84476 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-03-31 02:23:26.536 INFO 84476 --- [ restartedMain] p.a.s.SpringbootdockerApplication : Started SpringbootdockerApplication in 12.887 seconds (JVM running for 14.414)
Use IDE
Just click “Run”
Use Spring Boot Cli
$ spring run SayHelloApplication.java -- --server.port=9999
額外補充
上面這些在Terminal裡面執行的可以搭配Linux的命令使用會更加方便
Command:^z
%
jobs
bg
fg