我正在寻找一种自动收集所有 IntelliJ 静态代码分析警告(编译器和检查)的方法,而无需运行 UI 并单击按钮。理想情况下,我想从命令行运行 IntelliJ 编译器并将所有警告记录到一个文件中。这可能吗?
最佳答案
取自Working with IntelliJ IDEA Features from Command Line :
To launch a code inspection from the command line, specify the following command line arguments:
- Path to the launcher: specify the full path to one of the following launchers (which reside under the bin directory of your IntelliJ IDEA installation):
- For Windows:
inspect.bat
- For UNIX :
inspect.sh
- Project file path is the full path to the *.ipr file or .idea directory of the project to be inspected.
- Inspection profile path is the full path to the profile, against which the project should be inspected. The inspection profiles are stored under
USER_HOME\.IntelliJ IDEAXX\config\inspection
- Output path is the full path to an existing directory where the report will be stored.
- Options. You can specify: The directory to be inspected -d The verbosity level of output -vX, where X is 0 for quiet, 1 for noisy and 2 for extra noisy.
Please note that you have to specify full paths, relative paths are not accepted.
关于java - IntelliJ 命令行编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30622865/