问题描述
我的maven模块中有一个依赖项com.somecompany.somelib。
我的源代码中有一些使用此依赖项的类。
如果我从classpath
的{{1}}中删除了此依赖关系,则会发现intellij
的模块构建失败(预期)。
但是,从pom.xml中删除依赖项后,通过命令行在此模块上执行intellij
时,情况并非如此。构建仍然在应该失败的地方成功! (没想到)
我已经检查了启用了mvn clean install
选项的情况,但没有看到添加的依赖项。我看到正在编译的类文件,甚至在生成的.jar文件中也看到了.class文件。
--debug
日志中没有此依赖项名称。
我花了一整天的时间进行搜索和阅读,但找不到任何解决方案/可能的原因。
如果有帮助,以下是一些其他信息。
--debug
maven version - Apache maven 3.6.0
basedir = /home/user/git/repo/projectname/modulename
buildDirectory = /home/user/git/repo/projectname/modulename/target
compileSourceRoots = [/home/user/git/repo/projectname/modulename/src/main/java]
compilerId = javac
debug = true
encoding = UTF-8
failOnError = true
forceJavacCompilerUse = false
fork = false
optimize = false
source = 8
staleMillis = 0
target = 8
useIncrementalCompilation = true
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)