How to make one module depend on another module artifact?

Solution 1:

Try ${project.version}

e.g.

<dependency>
   <groupId>AAA</groupId>
   <artifactId>B</artifactId>
   <version>${project.version}</version>
</dependency>

Solution 2:

Looks like it should work to me. But you might try mvn install instead of mvn package.