Maven在终端中找不到io.reactivex.subject,在Eclipse中成功

时间:2018-10-05 18:32:29

标签: java eclipse maven terminal

在尝试为Gitlab CI准备个人项目时,我偶然发现了一个问题,即maven在终端中找不到io.reactivex.subjects软件包,结果编译失败,如下所示:

[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ spell-idle ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /home/aschaefer/dev/spell-idle/target/classes
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spell-idle: Compilation failure: Compilation failure: 
[ERROR] /home/aschaefer/dev/spell-idle/src/com/aps/spells/rx/GuiSubjects.java:[5,29] package io.reactivex.subjects does not exist
[ERROR] /home/aschaefer/dev/spell-idle/src/com/aps/spells/rx/GuiSubjects.java:[6,29] package io.reactivex.subjects does not exist
[ERROR] /home/aschaefer/dev/spell-idle/src/com/aps/spells/rx/GuiSubjects.java:[14,29] cannot find symbol
[ERROR]   symbol:   class Subject
[ERROR]   location: class com.aps.spells.rx.GuiSubjects
[ERROR] /home/aschaefer/dev/spell-idle/src/com/aps/spells/rx

这可能是pom的相关部分。如果还有其他需要,请通知我,我将在以下位置进行编辑:

<dependencies>
    <dependency>
        <groupId>io.reactivex.rxjava2</groupId>
        <artifactId>rxjavafx</artifactId>
        <version>2.2.2</version>
    </dependency>
... (other dependencies here)
</dependencies>

我一直在运行mvn clean installmvn compile test之类的各种命令组合,但似乎无济于事。

Eclipse的maven版本为3.5.3,系统版本为3.5.2。

〜/ .m2目录中没有settings.xml。

在此先感谢您提供的任何帮助!

1 个答案:

答案 0 :(得分:1)

您说eclipse在工作,请转到Preferences>Maven>user settings,您将看到eclipse mvn配置,并将其与系统上通常在~/.m2/settings.xml或环境变量{{ 1}}