
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"Į:\mavenproject\mavendependency>cd mytest1 Java home: C:\Program Files\Java\jdk1.7.0_13\jreĭefault locale: en_US, platform encoding: Cp1252 Java version: 1.7.0_13, vendor: Oracle Corporation So, let’s perform a “mvn clean install” to install the mytest1 artifact (ie, the mytest jar file) into the local maven repository.Ĭ:\Documents and Settings\atanu>mvn -versionĪpache Maven 3.0.2 (r1056850 06:28:10+0530)

At this point, “mytest2” can’t see anything in “mytest” because there is no classpath reference in mytest2 to mytest. Now, let’s suppose that we’d like the mytest2 class to call mytest1.sayHello(). There are *.java file and pom.xml for mytest1 and mytest2, which are required for compiling maven project.Īs we all know maven follow some structure, you will see some tree structure in my github repo. Suppose we have two very simple projects, “mytest1” and “mytest2”īelow are the code you can find for mytest1 and mytest2, Please follow the below URL

Let’s see how we can one project as a dependency to another project.
