I have the following POM structure:
./foobar-common/pom.xml ./abc-window/pom.xml ./abc-datasource/pom.xml
Both abc-window pom.xml is as follows:
The parent in abc-window is listed as:
<parent>
<relativePath>../foobar-common/pom.xml</relativePath>
<groupId>hu.abc.ringcore</groupId>
<artifactId>foobar-common</artifactId>
<version>1.0</version>
</parent>
The parent in abc-datasource is listed as:
<parent>
<relativePath>../foobar-common/pom.xml</relativePath>
<groupId>hu.ratesoft.ringcore</groupId>
<artifactId>foobar-common</artifactId>
<version>1.0</version>
</parent>
So, they do not have the same groupId.
Use dependencyManagment
in parent pom
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
add all versions in parent pom, and use dependencies without version in children
EDIT
/pom.xml <-parent pom
/abc-window/pom.xml <-child module
/abc-datasource/pom.xml <-child module
and parent pom should contains
<project
...
<properties>
...
</properties>
<modules>
<module>abc-datasource</module>
<module>abc-window</module>
</modules>
<build>
<pluginManagment>
...
</pluginManagment>
</build>
<dependencyManagment>
...
</dependencyManagment>
</project>