【问题标题】:IntellijIdea doesn't recognize classes inside a jar in networkIntellij Idea 无法识别网络中 jar 中的类
【发布时间】:2020-01-17 16:17:37
【问题描述】:

在我的 pom.xml 文件中,我想添加一个位于网络中的依赖项,因此我执行了以下操作:

<properties>
        <rai.home>\\iis\runner</rai.home>
</properties>


<dependency>
    <groupId>com.rai.utilities</groupId>
    <artifactId>rai-utilities</artifactId>
    <version>4.0</version>
    <scope>system</scope>
    <systemPath>${rai.home}/jar/rai-utilities-4.0-SNAPSHOT.jar</systemPath>
</dependency>

当我运行 mvn clean install 时,它工作得很好,但是 IntellijIdea 无法在那个 jar 中找到类,我收到一个错误:java.package ... does not exist

如果我更改了路径并在本地机器中使用相同的 jar,如下所示:

<systemPath>D:/jar/rai-utilities-4.0-SNAPSHOT.jar</systemPath>

IntellijIdea 可识别此 jar 中的类。

我该如何解决这个问题?

【问题讨论】:

    标签: maven intellij-idea jar


    【解决方案1】:

    IntelliJ IDEA has no support for the UNC paths 在依赖项中,您可以使用映射驱动器作为解决方法,并通过映射驱动器号引用文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-09
      • 2021-12-10
      • 2019-04-27
      • 2022-10-04
      相关资源
      最近更新 更多