2016-03-06 64 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