英文:
Occurred an error while packaging spring-boot application by maven
问题
以下是您要求的翻译内容:
The IDEA应用程序告诉我,在打包我的easy-start spring-boot应用程序时,出现了以下错误:Invalid packaging for parent POM org.springframework.boot:spring-boot-starter-web:1.5.9.RELEASE,必须是“pom”,但实际是“jar”
。如何解决这个问题?
我的操作系统是macOS 10.15.7,安装了三个JDK(1.8、11、14),我正在使用maven-3.6.3,我的maven设置也已更改为JDK 1.8和11。
以下是pom.xml文件的内容:
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>SpringBoot-01-HelloWorld</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<parent>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
英文:
The IDEA app told me that Invalid packaging for parent POM org.springframework.boot:spring-boot-starter-web:1.5.9.RELEASE, must be "pom" but is "jar"
while I packaged my easy-start spring-boot application, how to solve this problem?
My platform is macOS 10.15.7 with 3 JDKs(1.8, 11, 14), and I am using maven-3.6.3, my maven settings are also changed the JDK to 1.8 and 11
The pom.xml file is as followed:
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>SpringBoot-01-HelloWorld</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<parent>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
答案1
得分: 1
以下是您要翻译的内容:
父 POM 应该是 Spring Boot 的父项目
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
英文:
The parent POM should be the Spring Boot parent project
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论