本文介绍了Intellij IDEA编译所有模块,即使我只要求1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中有几个具有复杂依赖结构的模块。当我想为1个模块编译和运行单元测试时,我希望IDEA忽略不相关模块中的任何编译错误。我怎样才能做到这一点?目前IDEA编译所有内容,即使我说编译模块1。

I have several modules in the project with a complex dependency structure. When I want to compile and run unit tests for 1 module, I want IDEA to ignore any compilation errors in unrelated modules. How can I do that? Currently IDEA compiles everything even if I say "compile module 1".

我不想为此设置几个不同的项目。

I don't want to setup several different projects for this.

推荐答案

在测试运行配置中指定相应的模块。 IntelliJ IDEA将仅编译此模块和所需的依赖项,如果此测试模块不依赖它们,则不会尝试编译其他模块。

In the test Run configuration specify the corresponding module. IntelliJ IDEA will compile only this module and required dependencies, it will not try to compile other modules if this test module doesn't depend on them.

如果由于某种原因它没有按预期工作,请尝试分享一个小样本来说明问题。

If for some reason it doesn't work as expected, please try to share a small sample to illustrate the problem.

这篇关于Intellij IDEA编译所有模块,即使我只要求1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 15:10