NocWriter / runsql-gradle-plugin

Gradle plugin for running SQL scripts
Apache License 2.0
3 stars 1 forks source link

unable to resolve class task #7

Closed alexei-28 closed 2 years ago

alexei-28 commented 2 years ago

In build.gradle:

plugins {
    // Apply the application plugin to add support for building a CLI application in Java.
    id 'application'
    // Build uber-jar
    id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
    id "com.nocwriter.runsql" version "1.0.3"
}

task<RunSQL>("createEmptyDB") {
    config {
        username = ""
        password = ""
        url = "jdbc:sqlite://c:\\dev\\temp\\myproject\\app\\data\\my.db"
        driverClassName = "org.sqlite.JDBC"
        scriptFile = arrayOf("/db/sqlite/create-tables.sql", "/db/sqlite/insert-tables.sql")
    }
}

But when I run:

gradle createEmptyDB

I get error:

What went wrong:
Could not compile build file 'C:\dev\temp\myproj\app\build.gradle'.
> startup failed:
  build file 'C:\dev\temp\myproj\app\build.gradle': 121: unable to resolve class task
   @ line 121, column 1.
     task<RunSQL>("createEmptyDB") {
     ^

  1 error

* 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 3s
alexei-28 commented 2 years ago

Not a bug