【问题标题】:Error while building docker image, Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli) on project构建 docker 映像时出错,无法在项目上执行目标 org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli)
【发布时间】:2021-09-30 08:46:25
【问题描述】:

来自 pom.xml 的 sn-p:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                <image>vasanth0202/microservice-${project.artifactId}:${project.version}</image>
                <pullPolicy>IF_NOT_PRESENT</pullPolicy>
                </configuration>
            </plugin>
        </plugins>
    </build>

在 Eclipse 中构建时遇到此错误, 运行方式-> Maven 构建-> 目标(spring-boot:build-image -DskipTests)-> 运行

[错误] 无法在项目货币交换服务上执行目标 org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli):无法解析 mojo 的配置org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image for parameter image: 在类 org.springframework.boot.maven.Image 中找不到默认设置器 -> [帮助 1]

我错过了什么吗?请帮忙。

【问题讨论】:

  • 你可能混合了来自不同 Spring Boot 版本的 jars/modules,导致了这个问题。
  • 我在图片标签中做错了。图片名称应该是 标签的一部分。 vasanth0202/microservice-${project.artifactId}:${project.version}

标签: java spring-boot docker maven


【解决方案1】:

我在图片标签中犯了一个错误。图片名称应该是名称标签的一部分。

修正pom.xml中的图片标签后,图片生成正常。

Screenshot

【讨论】:

    猜你喜欢
    • 2023-01-09
    • 2020-06-27
    • 2021-11-23
    • 1970-01-01
    • 2023-03-17
    • 2021-06-27
    • 2021-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多