2016-03-06 42 views
0

我使用Grails最新版本3.1.3,即,與GWT如何讓GWT Grails中工作3

我已經通過了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 
} 

回答

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的插件是可以添加到IDE的類路徑簡單的JAR文件。

所以儘量打包插件根據official deployment docs到罐子:

另一種方法是在Grails的3.0部署或以上是用於運行的JAR或WAR文件的新 支持。要創建可運行檔案, 運行的Grails包:

grails package

+0

謝謝,其實我跟蹤HTTP //搜索的位置,https://repo.grails.org/grails/core/org/grails/插件/ gwt/....那裏它只有1.0.2,所以我用它,然後它開始給這個上述錯誤,爲第二個解決方案,我下載了這個插件的zip文件,不知道如何放置它該文件夾,我應該把這個整個解壓縮的文件夾... – junaidp

+0

根據從你的stacktrace通信這些文件的版本1.0.2:'file:/ C:/Users/Junaid/.m2/repository/org/grails/ plugins/resources/1.2/resources-1.2.pom file:/ C:/用戶/ Junaid/.m2/repository/org/grails/plugins/resources/1.2/resources-1.2.zip' –

+0

謝謝,但我需要一個pom或.jar文件,放在這裏,我沒有看到在這個我從這個回購下載的zip文件中。 – junaidp