> 文档中心 > packaging‘ with value ‘jar‘ is invalid. Aggregator projects require ‘pom‘ as packaging.

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的打包方式

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

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中漏写了打包方式,所以要填上打包方式即可

 添加上打包方式就好了!

pom

 

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

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

 

如果对你有用就点个赞