我正在为非Web应用程序创建Spring-Boot应用程序,我想知道我必须使用的插件或过程。如何使用Spring Boot为非Web应用程序创建可执行Jar
中的微业务的发展,该插件在build.gradle
补充说明的是:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.6.RELEASE")
}
}
apply plugin: 'org.springframework.boot'
但是,当你执行JAR产生,罐子启动一个Tomcat,并且不需要这样的软件:
`Java的罐子consoleApp-0.7.0-SNAPSHOT.jar演示= demo``
2017-08-30 14:48:13.505 INFO 82718 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-08-30 14:48:13.510 INFO 82718 --- [ main] spring.ParamLoader : Loading data...
2017-08-30 14:48:13.510 INFO 82718 --- [ main] spring.ParamLoader : item:
2017-08-30 14:48:13.523 INFO 82718 --- [ main] spring.ConsoleApp : Started ConsoleApp in 4.648 seconds (JVM running for 5.257)
^C2017-08-30 14:48:18.502 INFO 82718 --- [ Thread-3] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot[email protected]6477463f: startup date [Wed Aug 30 14:48:09 CEST 2017]; root of context hierarchy
任何替代?
非常感谢提前。
胡安·安东尼奥
你不需要别的东西。什么是启动取决于依赖关系。如果您不包含tomcat(或其他支持的servlet容器),它将作为非web应用程序启动。 –