Grails / Gradle Plugin for Grails 2.0

I am trying to use the grailsgradle plugin with Grails version 2.0. Here is my build script:

buildscript { repositories { mavenRepo url: "http://repo.grails.org/grails/core/" } dependencies { classpath "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT", "org.grails:grails-bootstrap:2.0.0" } grailsVersion="2.0.0" } apply plugin: "grails" repositories { mavenCentral() mavenRepo url: "http://repo.grails.org/grails/core/" } dependencies { compile "org.grails:grails:2.0.0", "org.grails:grails-core:2.0.0", "org.grails:grails-crud:2.0.0", "org.grails:grails-datastore-core:1.0.2.RELEASE", "org.grails:grails-datastore-gorm:1.0.2.RELEASE", "org.grails:grails-hibernate:2.0.0", "org.grails:grails-logging:2.0.0" } 

The dependencies at the bottom of the script are different from the original "1.3.4" located here . When I use this script to create a grails project with gradle grails-init , it works correctly when creating the project. When I try to use gradle grails-run-app , I get the following errors:

 ~>gradle grails-run-app :grails-run-app | Configuring classpath | Error log4j:WARN No appenders could be found for logger (org.springframework.core.io.support.PathMatchingResourcePatternResolver). | Error log4j:WARN Please initialize the log4j system properly. | Error log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. | Compiling 38 source files | Compiling 8 source files..... | Error Error: The following plugins failed to load due to missing dependencies: [hibernate] - Plugin: hibernate - Dependencies: ! dataSource (Required: 2.0 > *, Found: Not Installed) [INVALID] - i18n (Required: 2.0 > *, Found: 2.0.0) - core (Required: 2.0 > *, Found: 2.0.0) - domainClass (Required: 2.0 > *, Found: 2.0.0) 

I suppose this means that I am lacking addiction, but I have no idea what addiction is. It seems that hibernate is the culprit, but I have included the jars of grails hibernate above. The list of cans between the two versions of the grail is different, so I'm not sure what should be included (or maybe there is not one, and this will not work). A list of dependencies can be seen here.

Any help resolving these errors would be greatly appreciated.

Usage: gradle 1.0, milestone-7 and grails 2.0.0

NOTE : the dependency "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT" is a local copy of the hint revision from github .

+4
source share
2 answers

Many thanks. This is a very useful thread to answer your question, you need to add "org.grails: grails-plugin-datasource: 2.0.1" when compiling, it solved the problem on my machine.

+1
source

It looks like you are missing a few dependencies ... Check out the Gradle / Grails app for a complete example of how to do this.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1396540/


All Articles