spring-aot-maven-plugin 在 mvn clean 包上失败

Luc*_*ira 5 java spring spring-mvc maven spring-boot

我有一个早期创建的项目,当尝试运行mvn clean package命令或任何其他 mvn 命令来构建我的 .jar 时,spring AOT 插件抛出以下错误:

[INFO] 
[INFO] --- spring-aot-maven-plugin:0.9.0:test-generate (test-generate) @ server ---
[ERROR] org.springframework.aot.CodeGenerationException: Could not generate spring.factories source code
Run Code Online (Sandbox Code Playgroud)

在研究过程中,我遵循了文档,但我看不到我的项目中发生了什么可能导致此错误。我什至尝试更改 spring-aot-maven-plugin 版本,但它不断返回相同的问题。

如果有人知道如何解决这个问题,那将是一个很好的帮助。谢谢。

这是我的 pom.xml:

[INFO] 
[INFO] --- spring-aot-maven-plugin:0.9.0:test-generate (test-generate) @ server ---
[ERROR] org.springframework.aot.CodeGenerationException: Could not generate spring.factories source code
Run Code Online (Sandbox Code Playgroud)

jsc*_*sse 2

这对我有用:

  1. spring-boot-devtools从常规依赖项部分删除依赖项
  2. 创建一个类似的个人资料
<profile>
    <id>local</id>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
    </dependencies>
</profile>
Run Code Online (Sandbox Code Playgroud)
  1. 仅使用local-profile 来运行: mvn -Plocal spring-boot:run或者通过将以下内容添加到配置文件部分将其设为默认值
<activation>
    <activeByDefault>true</activeByDefault>
</activation>
Run Code Online (Sandbox Code Playgroud)