简体   繁体   中英

Gradle only run test

I am new to gradle+java. I a use Intellij to debug a sophisticated unit test case on an algorithm. The problem is every time after I click the 'debug' button, it takes long time (~2min) to start my test case, and from the log as following, it seems gradle is checking dependencies first and there are hundreds of them. Since most of the time I just re-trigger the debugger with no or very little change(no dependency related) to test code. How can I skip the dependency checking and only build the test file when there is a change?

Parallel execution with configuration on demand is an incubating feature.
> Task :corporate:common:processResources NO-SOURCE
...
hundreds tasks
...
> Task :indexing:signals:user:testClasses UP-TO-DATE
> Task :indexing:signals:user:test   <= my test case there

The Intellij debug configuration

在此处输入图像描述

Press Alt + F12 to open the terminal, and execute the command like the following:

gradlew :indexing:signals:user:test

You can make gradle skip dependency checking by using the --offline parameter.

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