java - Maven 在终端中找不到 io.reactivex.subjects,在 Eclipse 中成功

标签 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 installmvncompile test,但它似乎没有帮助。

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

我的 ~/.m2 目录中没有 settings.xml。

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

最佳答案

正如你所说,在 eclipse 中工作正常,进入 Preferences>Maven>user settings ,你会看到 eclipse mvn 配置,并将其与你系统上通常在 中的配置进行比较~/.m2/settings.xml 或通过环境变量 $M2_HOME/conf/settings.xml

关于java - Maven 在终端中找不到 io.reactivex.subjects,在 Eclipse 中成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52671457/

相关文章:

java - Xamarin.Android Notification.Notify 不执行任何操作

java - Play Framework : "Action not found" error for GET route after AJAX call to PUT/POST

java - 遍历 JSON 文件中的多个对象

android - 为什么 Project/Properties/Android 在 Eclipse 中不起作用?

java - Eclipse - 安装新的 JRE (Java SE 8 1.8.0)

java - maven中的 war 项目依赖

java - 使用 Bean Projection 在 QueryDSL 中自动修剪

java - 摆脱 Eclipse 中的所有@Override 错误?

java - 不使用slf4j就不能使用log4j吗?

Maven,原型(prototype) :generate, 是否有用于此的 GUI 工具?