到目前为止,没有发现任何有趣的东西,我在这里,问一个问题。
我有一个Spring Boot应用程序,运行正常。问题是:自定义配置!我希望它在端口8081(而不是默认端口8080)上运行。因此,我在src / main / resources目录中添加了application.yml,并将其打包...并在端口8080上运行当我从intellij运行@SpringBootApplication类时,它确实在端口8081上运行(我刚刚添加了该应用程序。 yml文件。)为什么呢?
这是一个gradle多模块项目。T将application.yml文件添加到实际上打包到jar文件中的模块中。它使用Tha gradle shadow插件打包,并且确实在jar文件的根目录中包含application.yml文件。
application.yml是这样的:
server:
port: 8081
我真的不知道您需要什么信息,所以随时问!
任何想法都欢迎。
编辑1:启动服务器时出现“ Stacktrace”:
java -jar serverApp.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::
août 29, 2020 5:50:54 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-nio-8080"]
août 29, 2020 5:50:54 PM org.apache.catalina.core.StandardService startInternal
INFOS: Starting service [Tomcat]
août 29, 2020 5:50:54 PM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet engine: [Apache Tomcat/9.0.37]
août 29, 2020 5:50:54 PM org.apache.catalina.core.ApplicationContext log
INFOS: Initializing Spring embedded WebApplicationContext
août 29, 2020 5:50:55 PM org.apache.coyote.AbstractProtocol start
INFOS: Starting ProtocolHandler ["http-nio-8080"]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句