I have 3 independent projects in my main project. When I want to add the dependencies of these projects to main project, then first I am building the dependent projects and then finally building the main project. Is there is a way to build the dependent projects at the time of building the main project?
Sure, use a multi-module project
<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>com.company</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>someName</artifactId>
<name>someName</name>
<packaging>pom</packaging>
<modules>
<module>dependentProject1</module>
<module>dependentProject2</module>
<module>mainProject</module>
</modules>
</project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With