I am trying to add an external jar file according to the article

https://www.tutorialspoint.com/maven/maven_external_dependencies.htm

but idea can't resolve a class from the library after I took all steps article. Although if I move the cursor in pom.xml to "systemPath" and press cntrl+right mouse button idea points to jar file in tree project.

I've tried to press File->invalidate cashes/reset

What have not I done yet?

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.name</groupId>
<artifactId>generalTwo</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>lib_v1</groupId>
        <artifactId>lib_v1</artifactId>
        <version>1.0</version>
        <systemPath>${project.basedir}/src/lib/lib_v1.jar</systemPath>
        <scope>system</scope>
    </dependency>
</dependencies>

Screenshot from idea, structure of project

Also there is my lib in "project structure->modules->dependency" with name "maven:lib_v1:lib_v1:1.0"

0 Answers