在尝试为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 install
或 mvncompile 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/