Home > database >  What is conflicting with apply plugin: "org.grails.plugins.views-json"?
What is conflicting with apply plugin: "org.grails.plugins.views-json"?

Time:04-01

I am upgrading our gradle grails and gorm project following this guide https://docs.grails.org/4.0.0/guide/single.html#upgrading


FAILURE: Build failed with an exception.

* Where:
Build file '/Users/name/Desktop/git/project/app/build.gradle' line: 23

* What went wrong:
A problem occurred evaluating project ':app'.
> org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;

* 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 4s

The line in question is apply plugin: "org.grails.plugins.views-json"

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
grailsVersion=4.0.4
gormVersion=7.0.4.RELEASE
gradleWrapperVersion=5.0

CodePudding user response:

Make sure you have the apply plugin line for views-json after all your other apply plugin statements i.e.

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:"org.grails.grails-gsp"
apply plugin:"com.bertramlabs.asset-pipeline"
apply plugin: "org.grails.plugins.views-json"

Additionally, make sure you have specified the JSON views dependency at the top of your build.gradle file like so (note this is from a Grails 4.0.1 application):

buildscript {
    repositories {
        maven { url "https://repo.grails.org/grails/core" }
        maven {
            name = 'ajoberstar-backup'
            url = 'https://ajoberstar.org/bintray-backup'
        }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "org.grails.plugins:hibernate5:7.0.0"
        classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.0"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.10"
        classpath "org.grails.plugins:views-gradle:2.0.4"
    }
}

and again later in the build.gradle file

dependencies {
    developmentOnly("org.springframework.boot:spring-boot-devtools")
    compile "org.springframework.boot:spring-boot-starter-logging"
    ...
    compile "org.grails.plugins:views-json:2.0.4"
}
  • Related