Running mvn install
will solve your problem, but then you are solving it manually. It creates many complications when your projects change. What you need is a pom.xml that makes references to your sub projects:
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<groupId>X</groupId>
<artifactId>X</artifactId>
<version>0.1</version>
<name>X</name>
<packaging>pom</packaging>
<modules>
<module>project_A</module>
<module>project_B</module>
<module>project_C</module>
</modules>
<build>
<defaultGoal>package</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>src/assemble/bin.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Put this in a directory that contains those 3 directories in which each of your projects are. Then you can call mvn clean package
on this directory and Maven will magically solve the problem for you, building each project in the right order and making one project available to the others if there are dependencies.
BONUS: On the example above I am also adding a reference to a Maven Assemble, which you can use to pack all your projects into a single distribution.