从命令行运行IntelliJ配置

时间:2016-04-22 23:33:01

标签: java intellij-idea testng

我在Java IntelliJ项目中配置了各种执行和测试配置。是否可以从命令行对给定项目和配置执行IntelliJ?

1 个答案:

答案 0 :(得分:0)

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!

相关问题