I have two maven projects,
- testmvn
- mvnusedemo
testmvn:
<groupId>com.avs</groupId>
<artifactId>testmvn</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>testmvn</name>
mvnusedemo:
<groupId>com.avs</groupId>
<artifactId>mvnusedemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mvnusedemo</name>
now I have a class in project testmvn
package com.avs.Calculation;
public class AddNumbersME {
public int addNumbers(int a, int b) {
return a + b;
}
public int addNumbers(int a, int b, int c) {
return a + b + c;
}
}
i have run mvn install cmd, I got Build Success. In the local repo(.m2) I can see those jars
Now I am trying to use this class(AddNumbersME) in project mvnusedemo
- Added dependency in pom.xml of mvnusedemo
<dependency>
<groupId>com.avs</groupId>
<artifactId>testmvn</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
Now I can see the dependency added to the maven dependency folder in eclipse.
- Now trying to use the **AddNumbersME **
public static void main(String[] args) {
SpringApplication.run(MvnusedemoApplication.class, args);
AddNumbersME a = new AddNumbersME(); // getting error - could not resolve
}
error: AddNumbersME cannot be resolved to a typeJava
need help, do I am missing something ??