问题标签 [spring-boot-starter-parent]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
316 浏览

spring-boot - 带有 Oauth2 和 Spring-boot-starter-parent 版本 2+ 的 Spring Boot SSO

我从这里得到了一个简单的 SSO 示例项目

目前,该示例的工作方式如下。

现在我的问题是示例使用 spring-boot-starter-parent 版本 1.5.9.RELEASE

该示例还使用了 spring-cloud 依赖项。我读到 spring-cloud 将不支持 spring-boot-starter-parent 版本 2 或更高版本。

因此,我尝试从 app1 中删除 spring cloud 依赖项,经过一番艰难的尝试后,我可以启动应用程序。我的新pom如下。

现在在加载 app1 时,它将显示 sso 登录窗口。但是登录成功后会抛出404错误。

如果我在 sso-server 应用程序中进行相同的更改,授权将不起作用。授权 API 将抛出 404。

请帮我解决这个问题。 我的需要是,让这个应用程序像以前一样使用 spring boot starter parent version 2+ 工作。

0 投票
1 回答
2501 浏览

java - 为什么在将 spring-boot-starter-parent 父项目更新到最后一个 2.2.5.RELEASE 后构建 Spring Boot 项目时出现此错误?

我是Spring Boot的新手,在尝试更新spring-boot-starter-parent父项目时遇到了一些问题。

所以,一开始我有这个pom.xml文件(它工作正常,我可以构建项目,我没有问题):

如您所见,此pom.xml文件包含此部分:

如果我的断言错误,请纠正我:据我了解,这意味着我的pom.xml文件是spring-boot-starter-parent项目的另一个pom.xml文件的子文件,版本为 1.5.9.RELEASE。这个推理正确吗?如果这个pom.xml文件在哪里定义?

所以目前我成功地使用了这个父项目的1.5.9.RELEASE版本。它很老了,我想将它更新到最后一个2.2.5.RELEASE,如下所示:

https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

所以我只改变了前一个pom.xml文件的部分以这种方式:

问题是试图通过这个 Maven 命令构建项目:

我收到以下错误消息:

0 投票
1 回答
149 浏览

spring-boot - 自 spring-boot-starter-parent 2.1.12-RELEASE 以来,在 eclipse 中运行时,使用 jetty 的 Spring Boot 服务器默认不会转发到 index.html

更新:此问题存在于 9.4.25.v20191220 的码头中,我已将版本设置回它正确服务的 9.4.24。我不知道这是错误还是配置更改。

也许有人可以提供帮助,我很欣赏这是所有配置问题,但我只有将 spring-boot-starter-parent 从 2.1.10-RELEASE 升级到 2.1.13-RELEASE 时遇到这个问题。

使用 @SpringBootApplication 和其他所有默认设置,但以下 WebMvcConfigurer 除外(在此处的另一篇文章中找到)

使用 Jetty,并且在 \src\resources\public\ 中存在一个 Angular 项目,包括公共目录中的 index.html。

在之前的春季版本中,我可以导航到 localhost:8080,它会自动定向到 localhost:8080/list,这被设置为 Angular 项目索引文件中的重定向。

但是现在使用 2.1.13 我必须明确地转到 localhost:8080/index.html 这确实有效,重定向到 /list 并且我可以浏览网站,但是如果我刷新页面或者如果我明确地转到 :8080/list我得到白标签错误 500

我试过了:

1.

添加各种其他视图控制器规则:

registry.addViewController("/").setViewName("forward:/index.html"); registry.addViewController("/").setViewName("forward:index.html"); registry.addViewController("/**").setViewName("forward:index.html");

......但我不认为这些是问题。

2.

查看 ResourceHandlerRegistry 以查看默认资源位置,因此它应该选择我的 index.html 文件。

3.

添加 spring.resources.static-locations=classpath:/public/xxx/**

然后我去 localhost:8080/xxx/ 或 localhost:8080/xxx/index.html whitelabel 404

由于安全漏洞,我升级了 spring,所以目前很想回到 2.1.10 或 11,并且只提取缓解漏洞所需的依赖版本。我只是想知道出了什么问题,显然不喜欢被打败。

有谁知道是否有春季版本的变更日志可以揭示发生了什么变化?我想这可能是由于任何数量的依赖项目。

0 投票
0 回答
91 浏览

mongodb - 将 spring-boot-starter-data-mongodb 更新到更新版本

我正在开发一个旧版本的 spring-boot-starter 项目。

我需要将 mongo 驱动程序更新到至少 3.11(因为移动到具有更新版本的新 mongo 主机)。因为现在无法将整个项目更新为更新版本的 spring-boot-starter,所以我想专门更新 spring-boot-starter-data-mongodb。为此,我发现我可以通过以下方式做到这一点:

可以完成这项工作,但问题是它还更新了 jpa 驱动程序版本。有没有一种方法可以在不更新 spring-data-jpa 的情况下更新 spring-boot-starter-data-mongodb。

非常感谢

0 投票
0 回答
1504 浏览

spring-boot - java.lang.ClassNotFoundException:org.springframework.kafka.listener.RecordInterceptor

我有我的带有 maven 的 spring boot kafka 应用程序,并且我已经使用 spring-boot-starter-parent 和 spring-kafka 的最新版本更新了旧版本,如下所示。

  1. spring-boot-starter-parent 来自 2.1.7.RELEASE --to--> 2.2.7.RELEASE

  2. spring-kafka 从 2.3.7.RELEASE --to--> 2.4.6.RELEASE

在旧版本中,应用程序运行良好,但在更新后,我遇到了问题。

java.lang.IllegalStateException:无法加载 ApplicationContext 。. . . . .

引起:java.lang.ClassNotFoundException:org.springframework.kafka.listener.RecordInterceptor

请使用 spring 2.2.x 最兼容的 kafka 版本进行指导。

0 投票
1 回答
256 浏览

spring-boot - 未找到 Maven Spring boot 和 Spring Cloud pom 依赖项

我发现这很难识别所有突然中断的CI/CD 管道,因为 Spring boot pom 在该位置不再可用。

当我运行命令mvn clean install时,我看到下面两个 pom 放错了位置/不再可用,这在历史上已经工作了 3-4 年了 -

第一 -

第二个——

在 pom.xml 中,我在下面提到了依赖项 -

POM 提到了以下存储库 -

任何线索这里发生了什么?希望谅解。

注意:该项目是在 Spring 1.3.3 版本发布时构建的,我们无法立即更改版本。

0 投票
2 回答
447 浏览

kotlin - 升级 Kotlin 后字符串中缺少“toInt()”

有关如何解决此问题的任何建议?

在此处输入图像描述

0 投票
0 回答
31 浏览

spring-boot - 如何在 Springboot 2.5.0 中使用 @MappedSuperClass

我目前正在为我的新项目使用 Springboot 2.5.0 版。

我使用以下代码创建了一个实体类:

这在 Springboot 2.4.4 之前已经使用过,具有相同的代码库。但现在我在调试日志中收到此消息。

在此处输入图像描述

我目前尝试的唯一解决方法是从 Springboot 2.5.0 降级到 2.4.4。

0 投票
0 回答
83 浏览

spring - 升级 spring-boot-starter-parent 后无法从 application.properties 文件访问 Maven 配置文件属性“spring.profiles.active”

我将 spring-boot-starter-parent 从 2.3.1 升级到 2.5.5,现在无法将“spring.profiles.active”属性从 pom 注入到 application.properties 文件。我在控制台中获得的不是配置文件值“以下配置文件处于活动状态@spring.active.profile@”

我的 .pom 文件

应用程序属性

0 投票
1 回答
592 浏览

java - Spring boot 启动器依赖覆盖了 qpid-jms-client 的 netty 版本

我在 Spring Boot 项目中使用 QPID-JMS-Client(版本 0.59.0)。我想覆盖 netty 版本,因为这个版本的 QPID 带有 netty 版本:4.1.63.Final [1]。我想将netty版本覆盖到最新的:4.1.68.Final。我还在我的 POM 中使用 spring-boot-starter-parent(版本:2.3.12.RELEASE)作为父 pom,它还附带一个 netty 版本(4.1.65.Final)。我知道 Spring Boot 版本相当旧,应该更新。无论如何,似乎 spring-boot-starter-parent 强制执行其 netty 版本。

pom.xml:

由于我没有使用任何 spring boot 依赖项,我不明白为什么 netty 版本设置为4.1.65.Final

QPID-JMS-CLIENT 的 pom 通过属性netty-version[3] 定义 netty 版本,而 spring boot 使用netty.version. 如果我覆盖 spring boot 的属性,则 QPID 的版本会更改:

如果我覆盖 QPID 的版本,则根本没有效果:

所以我的问题是:

  • 为什么 maven 强制执行父 poms netty 版本,而依赖项带有显式的不同版本?(即使我降低了弹簧靴版本,netty 依赖项也设置为该版本)
  • 如何正确覆盖netty的版本?

问候

[1] https://mvnrepository.com/artifact/org.apache.qpid/qpid-jms-client/0.59.0

[2] https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.3.12.RELEASE

[3] https://github.com/apache/qpid-jms/blob/main/pom.xml#L40