I am creating a project with several modules with a flat structure, that is, the parent and child objects are in the same base directory. Parent is defined as
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>company</groupId> <artifactId>parent</artifactId> <packaging>pom</packaging> <version>1-0-SNAPSHOT</version> <name>child</name> <modules> <module>../child</module> </modules> (...)
while the child that it defines as
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>company</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>company</groupId> <artifactId>child/artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>child</name> (...)
(The names of companies and projects are confused)
What happens is that the module (the child) complains that he cannot find the parent, i.e.
Reason: Cannot find parent: company:child for project: company:child:war:1.0-SNAPSHOT for project company:child:war:1.0-SNAPSHOT
Is there an obvious solution to this that I missed, or is he not recommended to use the flat design of the project?
Edit: Fixed a typo.
maven-2
mikek
source share