Assuming MyEjbProject is not another Maven project that you have or want to build using maven, you can use system dependencies to bind to an existing project jar file, for example
<project> ... <dependencies> <dependency> <groupId>yourgroup</groupId> <artifactId>myejbproject</artifactId> <version>2.0</version> <scope>system</scope> <systemPath>path/to/myejbproject.jar</systemPath> </dependency> </dependencies> ... </project>
However, as a rule, it is better (and preferred) to install the package in the repository either by creating a maven project, either creating it, or installing it, as you already seem to be doing.
EDIT: If they are, however, dependent on each other, you can always create a separate parent project (should be a βpomβ project) by declaring the other two projects as your βmodulesβ. (Subsidiary projects should not have announced the third project as their parent). As a result, you will get a new directory for the new parent project, where you would probably also place two independent projects as follows:
parent |- pom.xml |- MyEJBProject | `- pom.xml `- MyWarProject `- pom.xml
The parent project will receive the "modules" section to name all the child modules. Then the aggregator will use the dependencies in the child modules to actually determine the order in which the projects should be created)
<project> ... <artifactId>myparentproject</artifactId> <groupId>...</groupId> <version>...</version> <packaging>pom</packaging> ... <modules> <module>MyEJBModule</module> <module>MyWarModule</module> </modules> ... </project>
Thus, projects can relate to each other, but (as soon as they are installed in the local repository) are still used independently as artifacts in other projects
EDIT2:
Finally, if your projects are not related to related directories, you can try to provide them as relative modules:
filesystem |- mywarproject | `pom.xml |- myejbproject | `pom.xml `- parent `pom.xml
now you could just do it (worked in maven 2, just tried):
<project> <modules> <module>../mywarproject</module> <module>../myejbproject</module> </modules> </project>