1

I'm using Java 11 for the project. Gradle version is 5.5. IntelijIDEA 2019.1.3

So, when I'm building the project, I get the error:

Cause: invalid type code: B3

Stacktrace shows me:

org.gradle.internal.exceptions.LocationAwareException: Build file 'D:\project\scripts\build.gradle' line: 21
A problem occurred evaluating project ':scripts'.
    at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:99)
    at org.gradle.initialization.exception.DefaultExceptionAnalyser.collectFailures(DefaultExceptionAnalyser.java:55)
    at org.gradle.initialization.exception.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.initialization.exception.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:29)

And the command gradle task dev update tells me:

* What went wrong:
A problem occurred evaluating project ':scripts'.
> Could not find method leftShift() for arguments [build_44ncodnspa3jbc57fnmmpuh13$_run_closure1@4c5511e6] on task ':scripts:dev' of type org.gradle.api.DefaultTask.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED

In build.gradle file code that gives me the error is:

task("dev") << {
    println "executing dev"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                classpath "$projectDir/src/main/resources/"
                url 'jdbc:postgresql://localhost:5432/project'
                username 'testName'
                password 'testPassword'
                liquibaseSchemaName 'liquibase'
            }
        }
    }
}

I used solution with unticking the flag Settings -> Experimental -> Only sync the active variant.

But can I solve the issue via code and without changing IntelijIDEA settings? Because syncing the project is important thing as process of optimization. Especially, if it's large project.

invzbl3
  • 5,872
  • 9
  • 36
  • 76

1 Answers1

0

After analyzing and finding updated syntax, I changed a bit to:

task("dev") {
    doLast {
        println "executing dev"
        liquibase {
            activities {
                main {
                    changeLogFile changeLog
                    classpath "$projectDir/src/main/resources/"
                    url 'jdbc:postgresql://localhost:5432/project'
                    username 'testName'
                    password 'testPassword'
                    liquibaseSchemaName 'liquibase'
                }
            }
        }
    }
}

Eventually, updated code helped me to solve the issue without using settings of IntelijIDEA.

And gradle task dev update works successfully.

Community
  • 1
  • 1
invzbl3
  • 5,872
  • 9
  • 36
  • 76