无法使用Help Maven向项目添加外部依赖项。想法无法从依赖项中解析类

时间:2019-04-26 20:28:32

标签: java maven

我正在尝试根据文章

添加一个外部jar文件。

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

但是在我完成所有步骤文章之后,想法无法从库中解析类。 虽然如果我将pom.xml中的光标移动到“ systemPath”并按cntrl +鼠标右键,则指向树项目中的jar文件。

我试图按File->使兑现/重置无效

我还没做什么?

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

“项目结构->模块->依赖关系”中也有我的库,名称为“ maven:lib_v1:lib_v1:1.0”

0 个答案:

没有答案