赞
踩
子项目用maven打包的时候报错,
解决方法:父项目springcloud_demo的pom.xml指定打包方式:<packaging>pom</packaging>
- <?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.cloud</groupId>
- <artifactId>springcloud_demo</artifactId>
- <version>1.0-SNAPSHOT</version>
-
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.6.RELEASE</version>
- </parent>
-
- <packaging>pom</packaging>
-
- </project>
PS:子项目打包前,父项目要先打包否则会报错:
Could not find artifact com.cloud:springcloud_demo:pom:1.0-SNAPSHOT
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。