Y
Y
Yasuro2019-04-25 22:29:59
Java
Yasuro, 2019-04-25 22:29:59

Why can't idea see external Maven dependency with scope=system?

Hello.
I want to connect an external jar file to the project, I follow this guide https://www.tutorialspoint.com/maven/maven_externa...
The folder structure is shown in the screenshot below, pom is:

<?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>
</project>

idea doesn't see my "libClass" class. What did I do wrong?
5cc209f1de493467954009.png
Do not offer the option to connect via "project structure -> module, etc." Creating my own local repository, and even more so dealing with some kind of Nexus, is also not my option. The guide to which I threw off the link is what I need, but for some reason it does not work.
My ultimate goal is to build the project and tell maven that certain dependencies should not be included in the build, they should be included from outside, in this case from the lib folder.
Tried to reboot and pressed file-> invalidate caches\restart, hovered over libClass, pressed alt+enter. Interestingly, if I click on the groupId or artifactId in the pom file with control, then idea will highlight the required jar in the project tree.
5cc3f6c4cd29a438515744.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question