gpt4 book ai didi

Mvn:package spring boot - not include starter-* jar [closed](MVN:套装弹簧靴-不包括启动器-*JAR[关闭])

转载 作者:bug小助手 更新时间:2023-10-28 22:14:54 24 4
gpt4 key购买 nike




maven package command does not includes spring-boot-stater-*.jar in generated jar

maven package命令在生成的jar中不包含spring-boot-stater-*.jar


Fresh Spring boot project - Spring Initializr to Download project I used with any starter-* dependency,

Fresh Spring Boot项目-Spring Initializr用于下载我与任何starter-*依赖项一起使用的项目。


mvn clean package

enter image description here


As shown in picture Dependecy:tree(Left) starter JARs are missing in actual JAR generated

如图所示:生成的实际JAR中缺少树(左)启动器JAR


Why this Starter-* jars are missing in final packaged JAR?

为什么这个Starter-*罐子在最终包装的罐子里不见了?


UPDATE:

最新情况:



  • Tried changing spring boot version to 2.7.15 - same result


更多回答
优秀答案推荐

These starter jars don't contain anything useful. They are mainly a mechanism to include other sets of dependencies/jars. It's not harmful for Spring to purposefully strip them out when building the jar.

这些开胃菜罐子里没有任何有用的东西。它们主要是一种包含其他依赖项/JAR集的机制。Spring在构建JAR时故意将它们剥离出来,这是无害的。


I found this question What are `spring-boot-starter` jars? and this comment was useful:

我发现了一个问题,什么是‘弹簧靴子启动器’罐?这条评论很有用:



The starter jars themselves are effectively empty as far as your application is concerned. Some do include a META-INF/spring.provides file which IDEs can use to offer context-assistance with POM updates. The main reason for choosing an "empty" jar over POM packaging is that they are easier to use (you don't need to remember to add pom).



更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com