Triggering an IntelliJ build from commandline
Hello!
I need to automate triggering builds on IntelliJ IDEA. We have a java Gradle project, but use the IntelliJ build system. Is there any way to do that? Any commands or API? Maybe using jps directly from command line somehow?
I know there is a TeamCity which can automate builds, and I am looking into it, but I am afraid it's not gonna fulfill my requirements.
There are two other possible options I am thinking of. One is just opening an IntelliJ IDEA instance from script and sending simulated key-strokes (there is a keybind for triggering a project build), but the problem with this is I don't know how to know when the build finishes so I can close the IntelliJ IDEA instance. Another option is using GUI automation tool like pyautogui.
Any help will be appreciated. Thanks in advance!
请先登录再写评论。
I'm afraid that there's no such command lines or API can be provided here for triggering the intellij build system.
May I ask the use case here?
I know this thread is a few years old, but I stumbled across it and wanted to share something that might still be relevant!
I've actually built a plugin that solves exactly this — Remote Build Trigger for IntelliJ IDEA.
It starts an embedded HTTP server directly inside IntelliJ, allowing you to trigger a project build remotely via a simple HTTP GET request — no additional tooling or complex configuration required.
You can find it on the JetBrains Marketplace here:
👉 https://plugins.jetbrains.com/plugin/30650-remote-build-trigger
Have Fun!