0

I am having a weird issue. I added an interface in a different module, and the IDE compiles fine and everything works fine when I run it on my IDE, but when I do mvn clean install I get an error saying cannot find symbol MyInterface. Here is the log of the mvn clean install:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/path/to/MyClass.java:[5,37] cannot find symbol
  symbol:   class MyInterface
  location: package path.to.where.interface.lives
[INFO] 1 error
[INFO] -------------------------------------------------------------

And the line in MyClass.java where it's complaining about is:

import path.to.where.interface.lives.MyInterface;

And my interface looks like this:

package path.to.where.interface.lives;

public interface MyInterface {
    public void method();
}

I even added the dependency to the path.to.where.interface.lives package, in the pom file of where MyClass.java lives, but I am still seeing the issue.

mentallurg
  • 4,967
  • 5
  • 28
  • 36
12435432nm
  • 121
  • 4
  • 19

1 Answers1

0

I was able to resolve this issue by running mvn clean install on the entire project first, as I was originally running mvn clean install only on a specific module.

12435432nm
  • 121
  • 4
  • 19