gpt4 book ai didi

java - 项目构建错误 : Invalid packaging for parent POM [unknown-group-id]:[unknown-artifact-id]:[unknown-version], 必须是 "pom"但实际上是 "jar"

转载 作者:行者123 更新时间:2023-12-02 05:27:33 30 4
gpt4 key购买 nike

当我为 spring-boot 创建启动项目时,我在 pom 文件中收到此错误。这只是为了创建一个基本的 Spring Boot 项目

Project build error: Invalid packaging for parent POM [unknown-group-id]:[unknown-artifact-id]:[unknown-version], must be "pom" but is "jar"

<!-- This is the pom which from https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started-first-application.html -->
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>myproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
</parent>
</project>

最佳答案

您的父项目有 <packaging>JAR</packaging>不是 POM。要创建具有所有所需依赖项的 Spring Boot 项目,您可以使用 https://start.spring.io/ .

关于java - 项目构建错误 : Invalid packaging for parent POM [unknown-group-id]:[unknown-artifact-id]:[unknown-version], 必须是 "pom"但实际上是 "jar",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56220627/

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