I want to create a Maven project. I want it to have a parent project. The problem is that the parent project has a package in: war. I see an error :
Invalid packaging for parent POM must be "pom" but is "war"
What should I do ?
I want to create a Maven project. I want it to have a parent project. The problem is that the parent project has a package in: war. I see an error :
Invalid packaging for parent POM must be "pom" but is "war"
What should I do ?
Copyright © 2021 Jogjafile Inc.
A parent project (
packaging
with typepom
) is by definition a container of submodules. Only the submodules are allowed to be of specific packaging types (likewar
orjar
). You use a parent project to aggregate common dependencies and build configurations.I suggest that you put the code you want to reuse in a submodule of type
jar
and then add this submodule as a dependency of other projects you have (with packaing typewar
orjar
).You could read Chapter 6 of the book Maven by Example where it illustrates how to build a maven multi-module project.