The install-plugin command is deprecated in Grails - grails

i am new in grails..i try to install plugin using the command "install-plugin easygrid:1.5.0" in run. i got the warning as follow
"| Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies.
| Resolving plugin easygrid:1.5.0. Please wait...
| Error resolving plugin [name:1.5.0, group:easygrid, version:latest.integration]. Plugin not found.
| Error Plugin not found for name [easygrid:1.5.0] and version [not specified]"
how to install-plugins in run or using BuildConfig.grooovy in grails?
thanks in advance

Look at the Dependency section on the Grails' plugin page, it should be located near the top of the page right under the author & licence sections. Copy the text from there into your BuildConfig.groovy file into the plugins block and (re)start Grails.
Your BuildConfig could look like this:
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
//..some other configuration
grails.project.dependency.resolution = {
//..some other configuration and blocks
plugins {
//.. other plugins
compile ":easygrid:1.6.9"
}
}

Related

Creating Ldap Plug ii Grails 2.3

I'm trying to move my project from Grails 2.2.4 to Grails 2.3.5, and I need some plugins, one of them is Ldap's. To access to my repository I have an URL:
grailsRepo "http:// svn................"
and my dependency resolver is maven
an Y have this code after:
plugins {
// plugins for the build system only
build ":tomcat:7.0.50"
// plugins for the compile step
compile ":scaffolding:2.0.1"
compile ':cache:1.1.1'
// plugins needed at runtime but not for compilation
runtime ":hibernate:3.6.10.7"// or ":hibernate4:4.1.11.6" or hibernate:3.6.10.7
runtime ":database-migration:1.3.8"
runtime ":jquery:1.10.2.2"
runtime ":resources:1.2.1"
compile ":ldap:0.8.3.2"
}
and I got the next error
The following artifacts could not be resolved: org.grails.plugins:ldap:zip:0.8.3.2, org.grails.plugins:spring-security-ldap-dcas:zip:1.0.6: Could not find artifact org.grails.plugins:ldap:zip:0.8.3.2 in grailsCentral (http://repo.grails.org/grails/plugins)
|Run 'grails dependency-report' for further information.
It looks like the latest version of the ldap plugin is 0.8.2 - see http://grails.org/plugin/ldap
If this is a custom build that's in your local repo, try switching to the ivy resolver

grails ui plugin not working with grails 2.1.0

I wanted to test some of the features like expandablePannels etc before putting into another project, so I created a new project with a CRUD just so I can use grails ui
I am using Intellij 11, so I installed the plugin and was responded with the following error:
Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:yui:[2.6.0,)
IDEA hook: Grails not found!
| Error java.lang.NullPointerException
| Error at org.jetbrains.groovy.grails.rt.Agent$2.run(Agent.java:99)
| Error at java.lang.Thread.run(Thread.java:680)
Anyone else having issues using this plugin ?
Yet easier:
Edit BuildConfig.groovy and change the lines of the plugin dependency by these:
compile ":yui:2.8.2.1"
compile (":grails-ui:1.2.3") {
excludes 'yui'
}
Just in case it's useful to you.
I ran into same problem while upgrading my app from grails 1.3.7 to 2.1.0. yui is a dependency for grails-ui plugin (as grails-ui needs bubbling, and bubbling needs yui :-/) This is what I did :
Goto .grails/ivy-cache/org.grails.plugin/grails-ui folder
Open the file ivy-(version).xml (ivy-1.2.3.xml)
Look for this line : <dependency org="org.grails.plugins" name="yui" rev="**[2.6.0,)**" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
Replace [2.6.0,) with 2.8.2, so final line will look like this : <dependency org="org.grails.plugins" name="yui" rev="2.8.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)">
grails clean and grails compile
After this, this error was gone for good.
Hope this helps.
UPDATE :
Thanks to predicador37 ; Much cleaner & groovy-way of doing this - Put this under plugins in BuildConfig.groovy :
compile ":yui:2.8.2.1"
compile (":grails-ui:1.2.3") {
excludes 'yui'
}

Trouble including external jar required for an import in a src/java/{somename}.java in a grails-app( grails2.0)

I need a DHTMLXCONNECTOR.jar (a connector executable jar) in my grails app to use with my application otherwise i get errors like :
error compiling in javac connot find symbol : import com.dhtmlx.connector
please help !I tried grails install-dependencies dhtmlxconnector .. Is it, that i need to edit the buildconfig file ? like something similar to uncommenting runtime for mysql ?
(grails 2.0.1)
Add your dependency to the dependencies section of BuildConfig.groovy.
For example to add the dependency with
groupId: org.jsoup
artifactId: jsoup
version: 1.6.1
dependencies {
compile 'org.jsoup:jsoup:1.6.1'
}

Grails/Gradle Plugin for Grails 2.0

I'm trying to use the grails-gradle 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 than the original "1.3.4" located here. When I use this script to create a grails project with gradle grails-init it works correctly, creating the project. When I try to use gradle grails-run-app I receive 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'm assuming that this means I'm missing a dependency, but I have no idea what dependency. It looks like hibernate is the culprit, but I have included the grails hibernate jar above. The list of jars between the two versions of grails are different, so I'm not sure which should be included (or maybe there isn't one and this will not work). The list of dependencies can be see here.
Any help resolving these errors would be much appreciated.
Using:
gradle 1.0, milestone-7 & grails 2.0.0
NOTE: the dependency "org.grails:grails-gradle-plugin:1.1.1-SNAPSHOT" is a local copy of the tip revision from github.
Thanks a lot. This is a very helpful thread, to answer your question, you need to add "org.grails:grails-plugin-datasource:2.0.1" on compile, it solved the problem on my machine.
Looks like you're missing a few dependencies... Check Gradle / Grails application for a complete example of how to do this.
Hope this helps!

how to delete guilty jar file after grails dependency-report

when I tried to run grails -Dgrails.env=local run-app, I got the below error
Server failed to start: java.lang.LinkageError: loader constraint violation: loader (instance of ) previously initiated loading for a different type with name "javax/management/MBeanServer"
After analysing I understood that it has something to do with "Two dependencies link the same jar with different versions"
I ran grails dependency-report, and here is the observation:
commons-beanutils by commons-beanutils 1.8.3 release default false 227 kB
commons-beanutils by commons-beanutils 1.8.0 release default true 0 kB(evicted by 1.8.3)
How do I exclude this jar or remove the linkage?
The dependency report should show what is pulling in the problematic jar. Once you have that, explicitly exclude it from the dependencies in your BuildConfig.groovy, like so:
grails.project.dependency.resolution = {
dependencies {
runtime("i-depend-on-beanutils-1.8.3") {
excludes "beanutils"
}
}
}

Resources