繁体   English   中英

IntelliJ在运行时找不到Maven依赖项

[英]IntelliJ can't find Maven dependencies at runtime

我没有收到任何红线,但运行(Play)应用程序时IntelliJ找不到我的Maven依赖项。 尝试invalidate cache/restart 尝试运行mvn clean install

编译器错误信息

(compile:compileIncremental) Compilation failed
[info] Compiling 8 Scala sources and 5 Java sources to /Users/****/IdeaProjects/GeoMood/target/scala-2.11/classes...
[error] /Users/****/IdeaProjects/GeoMood/app/views/show_tweets.scala.html:1: not found: value twitter4j
[error] @import twitter4j.Status

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>groupId</groupId>
    <artifactId>geomood</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>edu.stanford.nlp</groupId>
            <artifactId>stanford-corenlp</artifactId>
            <version>3.8.0</version>
        </dependency>
        <dependency>
            <groupId>edu.stanford.nlp</groupId>
            <artifactId>stanford-corenlp</artifactId>
            <version>3.8.0</version>
            <classifier>models</classifier>
        </dependency>

        <dependency>
            <groupId>org.twitter4j</groupId>
            <artifactId>twitter4j-core</artifactId>
            <version>[4.0,)</version>
        </dependency>
    </dependencies>
</project>

有谁知道为什么IntelliJ不选择这个? Maven构建运行良好,并且依赖项在外部库下列出。

我通常必须执行以下操作以使IntelliJ知道对pom.xml中我的依赖项的更改:

  1. 在IntelliJ的项目视图中右键单击项目的根文件夹
  2. 转到“ Maven”菜单项,然后打开“ Maven”子菜单
  3. 单击重新导入 Maven弹出菜单

听起来您遇到了错误IDEA-148573

当Maven依赖项使用分类器时,IDEA在构建其类路径时会忽略该分类器,并尝试对该依赖项使用未分类的工件

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM