I want to use maven project 2 classes in my maven project 1 so that I can use it as a parent class. Can you please tell me how to do this using eclipse and JAVA. Please write in step by step navigation as I am new in maven.
Thanks in advance
I know its too late But this could help others who are searching for same problem.
suppose you have 2 projects p1 and p2 and you want to use p2 project's classes in p1 project then,
A) Right Click on your p2 maven project(If not maven project then convert it to maven) then
-->Choose Run As-->Click on Maven Install.
(It will make p2 to avaliable for other projects in your local maven repository)
B) Now you can simply add p2 project as dependency in p1 project's pom.xml file like this
<dependency>
<groupId>com.project.p2</groupId>
<artifactId>p2</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
For more details see this
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