0

When trying to use my own library I get the following error message

"The import xxx can not be resolved"

The code works since running mvn clean package runs the tests and successfully creates the .jar file but VSC does not seem to recgonize any imports.

In my main project i have the library in my pom as follows

    <dependency>
      <groupId>username.lastname</groupId>
      <artifactId>test-lib</artifactId>
      <version>0.0.1</version>
    </dependency>

and i looked in my local m2 repository there i can find the file test-lib.jar

From the library project i run mvn clean install to create the jar file

so it does exist but VSC does not seem to be able to use it.

I've tried to clean the java language space but the same issue still exist
I've tried to reload the project but the same issue still exist.

UPDATE: the issue seems to have to do with workspaces. If i open the project and only that project it works just fine. If I open the same project in a workspace java seem to be unable to detect my library.

santi254
  • 37
  • 3
  • Does this answer your question? [How to add local jar files to a Maven project?](https://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-to-a-maven-project) – dpr Mar 17 '23 at 14:57
  • No the issue is not finding the .jar file the issue is with VSC – santi254 Mar 17 '23 at 15:10

0 Answers0