Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何控制Grails3Gradle项目中的H2驱动程序版本?_Java_Grails_H2_Grails 3.0 - Fatal编程技术网

Java 如何控制Grails3Gradle项目中的H2驱动程序版本?

Java 如何控制Grails3Gradle项目中的H2驱动程序版本?,java,grails,h2,grails-3.0,Java,Grails,H2,Grails 3.0,如何在Grails/Gradle项目中控制H2驱动程序版本 使用H2运行grails3应用程序时遇到问题,我找到了这个答案:说明这可能是驱动程序版本差异造成的 我的IDE报告Grails应用程序使用1.3.176版本的H2,而我的服务器使用1.4.190。因此,我想升级应用程序的H2,但找不到它的定义。我查找了所有项目文件,但没有找到版本定义 更新 我当前的build.gradle: buildscript { ext { grailsVersion = project.

如何在
Grails
/
Gradle
项目中控制
H2
驱动程序版本

使用
H2
运行
grails3
应用程序时遇到问题,我找到了这个答案:说明这可能是驱动程序版本差异造成的

我的IDE报告
Grails
应用程序使用
1.3.176
版本的
H2
,而我的服务器使用
1.4.190
。因此,我想升级应用程序的
H2
,但找不到它的定义。我查找了所有项目文件,但没有找到版本定义

更新

我当前的
build.gradle

buildscript {
    ext {
        grailsVersion = project.grailsVersion
    }
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0'
        classpath "org.grails.plugins:hibernate:4.3.10.5"
    }
}

plugins {
    id "io.spring.dependency-management" version "0.5.2.RELEASE"
}

version "0.1"
group "multipleparentsgrails"

apply plugin: "spring-boot"
apply plugin: "war"
apply plugin: "asset-pipeline"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"

ext {
    grailsVersion = project.grailsVersion
    gradleWrapperVersion = project.gradleWrapperVersion
}

assets {
    minifyJs = true
    minifyCss = true
}

repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
}

dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
    }
    applyMavenExclusions false
}

dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"

    compile "org.grails.plugins:hibernate"
    compile "org.grails.plugins:cache"
    compile "org.hibernate:hibernate-ehcache"
    compile "org.grails.plugins:scaffolding"

    runtime "org.grails.plugins:asset-pipeline"

    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"

    // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
    testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'

    console "org.grails:grails-console"
}

task wrapper(type: Wrapper) {
    gradleVersion = gradleWrapperVersion
}

您应该能够像指定任何其他依赖项一样指定它


runtime“com.h2数据库:h2:1.4.190”

您应该能够像指定任何其他依赖项一样指定它


runtime“com.h2数据库:h2:1.4.190”

有许多依赖项可能使用h2。圣杯,冬眠,其他

我会参与你的项目。假设是$HOME/projects/myproj

1) 做一个依赖关系报告。将其导入grep,这样您就不必费力地阅读1000行报告,并查看正在使用的H2版本

cd $HOME/projects/myproj
./gradlew dependencies | grep 'H2'
2) 查找最高版本号,然后在build.gradle中显式包含该版本号,以强制每个依赖项使用最新版本:

dependencies {
    // all the other dependencies

    runtime "com.h2database:h2:1.4.190"  // where 1.4.190 is the most
                                         // current version.  as i
                                         // type this it is 1.4.191
                                         // according to maven central

}

有许多依赖项可能使用H2。圣杯,冬眠,其他

我会参与你的项目。假设是$HOME/projects/myproj

1) 做一个依赖关系报告。将其导入grep,这样您就不必费力地阅读1000行报告,并查看正在使用的H2版本

cd $HOME/projects/myproj
./gradlew dependencies | grep 'H2'
2) 查找最高版本号,然后在build.gradle中显式包含该版本号,以强制每个依赖项使用最新版本:

dependencies {
    // all the other dependencies

    runtime "com.h2database:h2:1.4.190"  // where 1.4.190 is the most
                                         // current version.  as i
                                         // type this it is 1.4.191
                                         // according to maven central

}

dependencies
下的
build.gradle
中,如果当前没有任何
H2
描述,它现在是如何工作的?如果根本没有指定它,它必须由另一个依赖项包含。发布你的
build.gradle
你可以通过gradle运行dependencyReport来查看它包含在哪里。实际上,这并不重要,为更高版本添加依赖项应该是可行的。在
依赖项下的
build.gradle
中,但是如果当前没有任何
H2
描述,它现在是如何工作的?如果根本没有指定它,它必须由另一个依赖项包含。发布你的
build.gradle
你可以通过gradle运行dependencyReport来查看它包含在哪里。实际上,这并不重要,为以后的版本添加依赖项应该可以。