IDEA JetBrains IntelliJ - 编译错误'make',但编译时使用Maven,没有IntelliJ在类文件中报告的错误 [英] IDEA JetBrains IntelliJ - Compile error on 'make' but fine when compiled using Maven and no errors reported by IntelliJ in the class file

查看:1103
本文介绍了IDEA JetBrains IntelliJ - 编译错误'make',但编译时使用Maven,没有IntelliJ在类文件中报告的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在IntelliJ中有一个maven模块(module-A)。我最近把一些类从它移到另一个新的maven模块(module-B),并添加了一个依赖。一旦我这样做,我还修改了一个移动的类(现在在模块B)的方法的签名。

So I have a maven module (module-A) in IntelliJ. I recently moved some classes from it into another new maven module (module-B) and added a dependency to it. Once I had done this I also modified the signature of a method of one of the moved classes (now in module-B).

我重新导入pom,以便IntelliJ可以获取依赖项更改,并确保所有受影响文件的Java导入重新正确。现在当我尝试运行我的webapp(这取决于两个模块)我得到一个编译错误在类中的模块A调用类的模块B中的修改方法。

I re-imported the poms so that IntelliJ would pick up the dependency changes and ensured all Java imports for the affected files were correct again. Now when I attempt to run my webapp (which depends on the two modules) I get a compile error in a class in module-A calling the modified method of the class in module-B.

错误消息基本上表示该方法不存在,但相信旧方法仍然存在!我点击'make'的错误,它需要我在一个类中的模块A调用修改的方法...奇怪的是,IntelliJ知道它是很好的文件。 ie方法没有下划线红色像编译错误通常是,但类文件名是:(

The error message is basically saying that that method doesn't exist but believes the old method still exists! I click on the 'make' error and it takes me to the line in a class in module-A calling the modified method...the weird thing is, IntelliJ knows it is fine in the file. i.e. The method is not underlined in red like a compile error would normally be, but the class file name is :(

我从命令行使用'mvn install '(也安装了module-B),它都是成功的。我删除了目录中的模块A和模块B的目录,也无效的IntelliJ的缓存和重新启动...仍在发生...任何想法?

I compiled it from the command line using 'mvn install' (having also installed module-B) and it is all successful. I have deleted the classes directory in the target of both module-A and module-B and also invalidated IntelliJ's caches and restarted...still happening...any ideas?

推荐答案

所以今天早上就这样说了,一切正常!

So just stated it up this morning and it's all working!

昨晚我做的是从模块A和模块B的父pom打开一个新项目(intelliJ项目),并成功地让它构建,可能这样做,然后再次打开我的原始项目固定它不知何故。 。非常讨厌,但

Last night what I did do was open a new project (intelliJ project) from module-A's and module-B's parent pom and successfully got it to build, possibly doing that and then opening my original project again fixed it somehow...very annoying though

这篇关于IDEA JetBrains IntelliJ - 编译错误'make',但编译时使用Maven,没有IntelliJ在类文件中报告的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆