Springboot 创建helloworld 打包报错

半山腰的人 2020-05-04 11:39:54
[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>
...全文
544 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_42573980 2020-05-09
  • 打赏
  • 举报
回复
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.3.RELEASE</version> </parent> ??试试??
半山腰的人 2020-05-04
  • 打赏
  • 举报
回复
<?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里面的我刚学不太清楚麻烦指教一下谢谢
hurtCat 2020-05-04
  • 打赏
  • 举报
回复

[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

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧