当前位置:   article > 正文

Invalid packaging for parent POM com.cloud:springcloud_demo:1.0-SNAPSHOT, must be “pom“ but is “jar“

Invalid packaging for parent POM com.cloud:springcloud_demo:1.0-SNAPSHOT, must be “pom“ but is “jar“

子项目用maven打包的时候报错,

解决方法:父项目springcloud_demo的pom.xml指定打包方式:<packaging>pom</packaging>

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5. <modelVersion>4.0.0</modelVersion>
  6. <groupId>com.cloud</groupId>
  7. <artifactId>springcloud_demo</artifactId>
  8. <version>1.0-SNAPSHOT</version>
  9. <parent>
  10. <groupId>org.springframework.boot</groupId>
  11. <artifactId>spring-boot-starter-parent</artifactId>
  12. <version>2.2.6.RELEASE</version>
  13. </parent>
  14. <packaging>pom</packaging>
  15. </project>

PS:子项目打包前,父项目要先打包否则会报错:

Could not find artifact com.cloud:springcloud_demo:pom:1.0-SNAPSHOT

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/451449
推荐阅读
相关标签