简体   繁体   中英

gradle execution failed for task :compileTestJava

I am trying to build my project but I get this error

Execution failed for task ':compileTestJava'
>Copilation failed; see the compiler error output for details

This is my build file:

apply plugin: "application"
apply plugin: "java"

mainClassName = "<package>.Main"

repositories
    {
    jcenter
        {
        url "https://repo1.maven.org/maven2/"
        }
    }

dependencies
    {
    // https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox
    implementation group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.1'
    }

test
    {
    useJUnitPlatform()
    testLogging
        {
        events "passed", "skipped", "failed"
        }
    }

I updated my build file. Now the project builds by using gradle run, but it doesn't using gradle check. Am I missing some dependencies to be able to use my test classes?

You need Gradle 4.6 or later for JUnit 5 support.

Unless you have a specific reason for using such an old version, you will probably want to use the latest (which at this time is 6.4).

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