[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Invalid packaging for parent POM org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE, must be "pom" but is "jar" @ org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.at:springboot-01-helloworld:1.0-SNAPSHOT (G:\ideacode\springboot01helloworld\pom.xml) has 1 error
[ERROR] Invalid packaging for parent POM org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE, must be "pom" but is "jar" @ org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
在網上找到<packaging>pom</packaging>
uj5u.com熱心網友回復:
[ERROR] Invalid packaging for parent POM org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE, must be "pom" but is "jar" @ org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE
問題說的很明顯了,專案需要的是pom打包方式的spring-boot-starter-web,而不是jar包
所以你是不是在搭建專案時繼承了錯誤的父工程了?父工程應該是spring-boot-starter-parent
uj5u.com熱心網友回復:
<?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>com.at</groupId>
<artifactId>springboot-01-helloworld</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<!--這個插件,可以將應用打包成一個可執行的jar包;-->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
麻煩你看看這是我pom.xml里面的我剛學不太清楚麻煩指教一下謝謝
uj5u.com熱心網友回復:
<parent><groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
??試試??
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/76143.html
標籤:Java EE
上一篇:java面試了個奇怪問題
下一篇:Java
