项目构建错误:父POM [unknown-group-id]:[unknown-artifact-id]:[unknown-version]的包装无效,必须为“ pom”,但为“ jar”

时间:2019-05-20 12:01:36

标签: java spring spring-boot

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

  

项目构建错误:父POM [unknown-group-id]:[unknown-artifact-id]:[unknown-version]的包装无效,必须为“ pom”,但为“ 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>

1 个答案:

答案 0 :(得分:0)

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