简体   繁体   中英

Run IntelliJ configuration from command line

I've configured various execution and test configurations in my Java IntelliJ project. Is it possible to execute IntelliJ on a given project and configuration from the command line?

Summary

You will need to define a command line build project to run your tests from the command line, as IntelliJ (or any graphical IDE) does not provide tools to do so.

Details for building running tests using Gradle

In the following directions I picked Gradle as command line build language, though some use Ant, or Maven as possible alternatives. The gradle syntax is based on Groovy, which is a JDK-based scripting language.

A sample configuration for a basic java project is here: http://www.vogella.com/tutorials/Gradle/article.html

Once your Gradle project is setup, you can run 'gw test' from command line.

I highly suggest to install gradle wrapper called 'gdub' from here: https://github.com/dougborg/gdub -- this will save typing ./gradlew all the time.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM