When you release this ear, you will deploy these modules with the same version?
If yes, then you can use it:
For example: project structure:
-EAR
pom.xml
--web-module
pom.xml
--ejb-module
pom.xml
Imagine that web-module has ejb-module dependency, then you can add in web-module project this dependency:
<dependency>
<groupId>your.groupId</groupId>
<artifactId>your.groupId</artifactId>
<version>${project.version}</version>
</dependency>
Hope it helps.