The method is undefined for the type [Class Name]

1.7k views Asked by At

I have to projects both contains the pom.xml , Let say Project A and Project B. In project B I added project A as dependency in its pom.xml. In project A there is a class Mirror.java, in this class I added method and then updated the Project B by right clicking on it and update project so the jar for Project A is updated with new code. Now when I try to call this method its not visible in Project B though the .class file in the Maven dependencies contains the new method

Project B pom.xml

  <dependency>
        <groupId>com.intel.imc.swa.jetdb</groupId>
        <artifactId>mirror</artifactId>
        <version>0.1.4</version>
    </dependency>

Project B Test.class

 new Mirror(db.getConnectionString(), "EABase_JET4_empty.eap",eap.getAbsolutePath()).webrun();

Project A Mirror.java

   public Mirror(String source, String template, String target) throws SQLException, IOException {
    this.sourceString=source;
    this.templateFileString=template;
    this.targetFileString=target;
} 


public void webrun() {
 System.out.print("test");
}

Why the webrun method is not available in Project B ?

Thanks

1

There are 1 answers

1
Adam Arold On BEST ANSWER

You have to build project A then project B. You also have to use the -U flag in Maven:

 $ mvn clean install  // in A
 $ mvn clean install -U // in B to force update of snapshots