Question: Why might you not want to include groupId and version elements in child POM files?

  1. If you include these elements, an error will be thrown when you try to build the project.
  2. These elements are inherited from the parent POM file, and do not need to be repeated.
  3. Child POM files should include definitions of only dependencies and plugins.
  4. The values in the parent POM will be overridden by what is defined in the child POM.

Answer: The correct answer of the above question is Option B:These elements are inherited from the parent POM file, and do not need to be repeated.