packaging‘ with value ‘jar‘ is invalid. Aggregator projects require ‘pom‘ as packaging.

'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging.

打包方式为jar包的打包方式无效,多模块项目需要POM的打包方式

packaging‘ with value ‘jar‘ is invalid. Aggregator projects require ‘pom‘ as packaging._第1张图片

 第二个箭头的地方指明了出问题的地方,

The project com.changgou:changgou_web:1.0-SNAPSHOT (C:\JavaProject\07changgou_class\changgou_parent_3622\changgou_web\pom.xml) has 1 error
[ERROR]     'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 4, column 109
 

到出问题的pom.xml中一看,它含有子模块,即它是多模块聚合,打包方式应该为pom

但是pom.xml中漏写了打包方式,所以要填上打包方式即可

packaging‘ with value ‘jar‘ is invalid. Aggregator projects require ‘pom‘ as packaging._第2张图片

 添加上打包方式就好了!

pom

packaging‘ with value ‘jar‘ is invalid. Aggregator projects require ‘pom‘ as packaging._第3张图片

 

多模块聚合时,parent父模块的packaging类型是pom,可以在parent父模块的pom中定义来包含下面的子模块,相应的子模块packaging类型才是jar;

聚合模块打包方式为pom, 单模块打包方式是jar

packaging‘ with value ‘jar‘ is invalid. Aggregator projects require ‘pom‘ as packaging._第4张图片

 

如果对你有用就点个赞

你可能感兴趣的:(springboot,springdata,SpringCloud,maven,java,spring)