1

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 ?

Nishant
  • 54,584
  • 13
  • 112
  • 127
hichemino
  • 11
  • 1
  • 2

1 Answers1

1

A parent project (packaging with type pom) is by definition a container of submodules. Only the submodules are allowed to be of specific packaging types (like war or jar). 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 type war or jar).

You could read Chapter 6 of the book Maven by Example where it illustrates how to build a maven multi-module project.

rcarraretto
  • 164
  • 2
  • 7