Grails 2.1.2 - UNRESOLVED DEPENDENCIES Error - grails

Am using Grails 2.1.2 on Windows 7 64-Bit System, at the time of compile it gives below error, kindly help me how to fix this.
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.grails.plugins#mail;1.0-SNAPSHOT: not found
:: org.grails.plugins#tomcat;1.3.2: not found
:: org.grails.plugins#hibernate;1.3.2: not found
:: org.grails.plugins#csl-rest-lib;1.0: not found
::::::::::::::::::::::::::::::::::::::::::::::

In BuildConfig.groovy, try to declare the dependencies:
dependencies {
compile 'org.grails.plugins:mail:1-0-SNAPSHOT'
compile 'org.grails.plugins:tomcat:1.3.2'
...
}

If your application was updated from grails 1.3 (<2.) or create from grails 2., you need to check plugins version on the grails plugins
For example, current version of mail plugin is 1.0.1 mail plugin
And also you need to check this dependencies at conf/BuildConfig.groovy. It must have part like this:
plugins {
build ":tomcat:$grailsVersion"
runtime ":hibernate:${grailsVersion}"
runtime ":resources:1.1.6"
...
Describe your plugins at plugins part.
And you need to check latest libraries for plugins and describe it like this:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
compile('org.apache.poi:poi:3.7',
'org.apache.poi:poi-contrib:3.6',
'org.apache.poi:poi-ooxml:3.7',
'antlr:antlr:2.7.6',
'org.apache.ant:ant-apache-log4j:1.7.1'
..

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 upgrade from 2.2.0 to 2.3.4

Hi I upgraded my Grails application from 2.2.0 to Grails 2.3.4, but I'm getting this error :
|Loading Grails 2.3.4
|Configuring classpath
Error |
Resolve error obtaining dependencies: Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.apache.tomcat.embed:tomcat-embed-core:7.0.47
- org.apache.tomcat:tomcat-catalina-ant:7.0.47
- org.apache.tomcat.embed:tomcat-embed-jasper:7.0.47
(Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails:grails-datastore-gorm-hibernate:2.0.6.RELEASE
- junit:junit-dep:4.10
(Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails:grails-datastore-gorm-hibernate:2.0.6.RELEASE
(Use --stacktrace to see the full trace)
Error |
Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.apache.tomcat.embed:tomcat-embed-core:7.0.47
- org.apache.tomcat:tomcat-catalina-ant:7.0.47
- org.apache.tomcat.embed:tomcat-embed-jasper:7.0.47
Any recommendations to fix this issue ?
From the Grails 2.3.4 Release Notes
If you are upgrading from previous versions of Grails 2.3.x and you use the Hibernate and/or Tomcat plugins you will need to update the versions in BuildConfig:
build ':tomcat:7.0.47'
runtime ':hibernate:3.6.10.6'
And since you are upgrading from 2.3, I think you should also read What's new in Grails 2.3?
Grails 2.3.4 requires you to upgrade most of your dependencies. I don't know all but I think you have to upgrade hibernate to hibernate 3. Here's what my current project's BuildConfig looks like:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.24'
//compile 'com.paypal.sdk:merchantsdk:2.4.103'
compile 'joda-time:joda-time:2.2'
compile ('org.apache.poi:poi:3.9','org.apache.poi:poi-ooxml:3.9')
compile 'com.stripe:stripe-java:1.3.0'
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.41"
// plugins for the compile step
compile ":scaffolding:2.0.0.RC1"
compile ':cache:1.1.1'
// plugins needed at runtime but not for compilation
runtime ":hibernate:3.6.10.6" // or ":hibernate4:4.1.11.M2"
runtime ":database-migration:1.3.5"
compile ":jquery:1.10.2"
runtime ":resources:1.2"
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0.1"
//runtime ":cached-resources:1.1"
//runtime ":yui-minify-resources:0.1.5"
//app plugins
compile ':webflow:2.0.8.1'
compile ":mail:1.0.1"
compile ":asynchronous-mail:1.0-RC5" //1.0
compile ":spring-security-core:1.2.7.3"
compile ':excel-export:0.1.10'
compile ":spring-security-core:1.2.7.3"
test ":spock:0.7"
}
This works for me.

Unable to Install searchable 0.6.5 for grails 2.2.3

When I need searchable 0.6.5 plugin for grails 2.2.3, I modifed BuildConfigh.groovy as following:
dependencies {
compile ":searchable:0.6.5"
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.3"
runtime ":resources:1.2"
test(":spock:0.7") {
exclude "spock-grails-support"}
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0"
//runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.5"
build ":tomcat:$grailsVersion"
runtime ":database-migration:1.3.2"
compile ':cache:1.0.1'
compile ":searchable:0.6.5"
}
After saving the file, I refresh dependency in order to install the plugin, but I got the message below:
Loading Grails 2.2.3
| Configuring classpath
| Downloading: searchable-0.6.5.pom.sha1
:: problems summary ::
:::: ERRORS
grailsCentral: bad organisation found in http://grails.org/plugins/grails-searchable/tags/RELEASE_0_6_5/searchable-0.6.5.pom: expected='' found='org.grails.plugins'
| Downloading: searchable-0.6.5.pom.sha1
:: problems summary ::
:::: ERRORS
grailsCentral: bad organisation found in http://grails.org/plugins/grails-searchable/tags/RELEASE_0_6_5/searchable-0.6.5.pom: expected='' found='org.grails.plugins'
| Downloading: searchable-0.6.5.pom.sha1
:: problems summary ::
:::: ERRORS
grailsCentral: bad organisation found in http://grails.org/plugins/grails-searchable/tags/RELEASE_0_6_5/searchable-0.6.5.pom: expected='' found='org.grails.plugins'
| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- :searchable:0.6.5
Process was killed
I thought it could be my internet problem, but I checked the internet connection is OK. Did you encounter problem like this? Could anyone help me solve install searchable 0.6.5 problem? Many thanks.
You can't use version 0.6.5 with 2.2.3 - see the notes at the plugin page: http://grails.org/plugin/searchable
Use version 0.6.4. The only difference is a trivial fix to get the plugin working in 2.3.

Error in Spring Security core plugin while upgrading grails from 1.3.x to 2.0.4

I have a app developed in grails 1.3.x and I upgraded to 2.0.4, There was an dependency error in the spring security plugin, so i did grails install-plugin spring-security-core, It installed 1.2.7.3 version. Then I ran the grails application, I got the below error.
Compilation error: startup failed:
Compile error during compilation with javac.
C:\Users\Vinay.hs\.grails\2.0.4\projects\steer\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springs
ecurity\AjaxAwareAuthenticationFailureHandler.java:48: cannot find symbol
symbol : method saveException(javax.servlet.http.HttpServletRequest,org.springframework.security.core.AuthenticationException)
location: class org.codehaus.groovy.grails.plugins.springsecurity.AjaxAwareAuthenticationFailureHandler
saveException(request, exception);
^
Then I added compile ':spring-security-core:1.2.7.3'. I got a different error as below
:::: WARNINGS
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: #spring-security-core;1.2.7.3: java.text.ParseException: inconsistent module descriptor file found in 'http://plugin
s.grails.org/grails-spring-security-core/tags/RELEASE_1_2_7_3/spring-security-core-1.2.7.3.pom': bad organisation: expected='' found='o
rg.grails.plugins';
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
grailsCentral: bad organisation found in http://plugins.grails.org/grails-spring-security-core/tags/RELEASE_1_2_7_3/spr
ing-security-core-1.2.7.3.pom: expected='' found='org.grails.plugins'
I referred this jira issue, According to that we have to change the dependency to runtime, but it it was giving me the below error
inconsistent module descriptor file found in 'http://plugins.grails.org/grails-spring-security-core/tags/RELEASE_1_2_7_3/spring-security-core-1.2.7.3.pom': bad organisation: expected='' found='org.grails.plugins';
So, How to resolve this issue.
Looks like you put the dependency in the BuildConfig.groovy dependencies section but it should be in the plugins section:
plugins {
runtime ":hibernate:$grailsVersion"
build ":tomcat:$grailsVersion"
...
compile ':spring-security-core:1.2.7.3'
}

Read jars from lib folder in grails

I want to parse an excel file using the Apache POI library to boot strap some data in development mode into my grails 2.0.1 application.
I've tried to use the Grails excel-import plugin but the plugin uninstalls automatically when I execute run-app.
Because of that I decided to got ahead without the plugin for now. First I have copied the next jars into the grails application lib folder
$ls -la lib
poi-3.7-20101029.jar
poi-ooxml-3.7-20101029.jar
poi-ooxml-schemas-3.7-20101029.jar
xmlbeans-2.3.0.jar
I've read that I should declare the dependency in grails-app/conf/BuildConfig.groovy. So, I added the next:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
compile ('org.apache.poi:poi:3.7', 'org.apache.poi:poi-ooxml:3.7')
// runtime 'mysql:mysql-connector-java:5.1.16'
}
However when I execute run-app the application is still not able to find the jars.
grails> run-app
| Compiling 76 source files
| Compiling 30 source files.
| Error Compilation error: startup failed:
UMEExcelImporter.groovy: 8: unable to resolve class org.apache.poi.xssf.usermodel.XSSFSheet
# line 8, column 1.
import org.apache.poi.xssf.usermodel.XSSFSheet
^
UMEExcelImporter.groovy: 7: unable to resolve class org.apache.poi.xssf.usermodel.XSSFWorkbook
# line 7, column 1.
import org.apache.poi.xssf.usermodel.XSSFWorkbook
^
UMEExcelImporter.groovy: 9: unable to resolve class org.apache.poi.xssf.usermodel.XSSFRow
# line 9, column 1.
import org.apache.poi.xssf.usermodel.XSSFRow
I am not using any IDE. Any feedback is welcome!
The POI jars are on public Maven repo's so try this:
Remove the jars from your lib folder
Clean your build with: grails clean
In you BuildConfig.groovy ensure that the "repositories" closure has "mavenCentral()" included/uncommented
Your dependency looks ok (I have not confirmed it) so now try the run-app
HTH
instead of adding compile dependency, try adding runtime dependency as follows.
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
runtime ('org.apache.poi:poi:3.7', 'org.apache.poi:poi-ooxml:3.7')
// runtime 'mysql:mysql-connector-java:5.1.16'
}

Resources