У меня есть многомодульный проект, и я использую профили в родительском pom, которые имеют определенные зависимости, упомянутые в них.Проблема здесь в том, что если в дочернем pom я перезаписываю элемент зависимости и упоминаю одну из зависимостей в родительском pom (которая объявлена в профиле в родительском pom), версия этой конкретной зависимости должна бытьупоминается снова.
Например, Pom pom
<dependencies>
<dependency>
<groupId>com.mycode.apps</groupId>
<artifactId>jobs</artifactId>
<version>4</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>common-dependencies</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.mycode.apps</groupId>
<artifactId>dao</artifactId>
<version>4</version>
</dependency>
</dependencies>
</profile>
</profiles>
Теперь в child pom.xml
<dependencies>
<!--this one doesnt need a version specified -->
<dependency>
<groupId>com.mycode.apps</groupId>
<artifactId>jobs</artifactId>
</dependency>
<!--this one makes maven throw an error(if version is not specified) while compilation -->
<dependency>
<groupId>com.mycode.apps</groupId>
<artifactId>dao</artifactId>
</dependency>
</dependencies>
Есть идеи, что может быть не так и как я могу это исправить ??
ПРИМЕЧАНИЕ. Профиль помечен как activeByDefault
.