如何让GWT与Grails 3

时间:2016-03-06 02:47:30

标签: grails gwt

我使用的是Grails最新版本,即3.1.3和GWT

我已经浏览了gwt / grails插件和他们的教程,但所有这些都是针对旧版本的grails,我们有“BuildConfig.groovy”,格式看起来不同。

现在我们有build.gradle,我无法找到一种方法将gwt插件放在那里

我试过的是:添加

         compile "org.grails.plugins:gwt:1.0.2"

现在当我运行命令时:

           grails create-gwt-module

我得到例外:

            Could not resolve all dependencies for configuration ':runtime'.
 > Could not find org.grails.plugins:resources:1.2.
Searched in the following locations:
    file:/C:/Users/Junaid/.m2/repository/org/grails/plugins/resources/1.2/r
 sources-1.2.pom
    file:/C:/Users/Junaid/.m2/repository/org/grails/plugins/resources/1.2/r
 sources-1.2.zip
    https://repo.grails.org/grails/core/org/grails/plugins/resources/1.2/re
 ources-1.2.pom
    https://repo.grails.org/grails/core/org/grails/plugins/resources/1.2/re
  ources-1.2.zip
Required by:
    helloworld2:helloworld2:0.1 > org.grails.plugins:gwt:1.0.2

这是我的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:hibernate4:5.0.2"
}

}

 version "0.1"
 group "helloworld2"

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

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

 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-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:gwt:2.6.0"
console "org.grails:grails-console"
profile "org.grails.profiles:web:3.1.3"
runtime "org.grails.plugins:asset-pipeline"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
 }

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

assets {
minifyJs = true
minifyCss = true
}

1 个答案:

答案 0 :(得分:0)

您是否尝试获取compile "org.grails.plugins:gwt:1.0.3"the latest version of plugin

如果无法自动下载以从repo手动下载并将其放入本地maven存储库中的一个搜索位置?

official plugin docs中,您可以阅读:

  

在Grails 2.x中,插件被打包为ZIP文件,但是在Grails中   3.x插件是简单的JAR文件,可以添加到IDE的类路径中。

因此,请尝试根据official deployment docs将插件打包到jar:

  

在Grails 3.0或更高版本中部署的另一种方法是使用新的   支持可运行的JAR或WAR文件。要创建可运行的档案,   运行grails包:

     

grails package