-1

Is there a plugin for Excel import for grails 2.2.0? I tried to use http://grails.org/plugin/excel-import, but it shows me the following error:

...\services\org\grails\plugins\excelimport\ExcelImportService.groovy: 4: unable to resolve class org. joda.time.LocalDate @ line 4, column 1. import org.joda.time.LocalDate ^ 1 error

Here is the part of BuildConfig.groovy

    repositories {

        ...

    mavenRepo "http://repo.grails.org/grails/libs-releases/"
    mavenRepo "http://m2repo.spockframework.org/ext/"
    }
    plugins {
      compile ":excel-import:1.0.0"
      ...
   }

Any help is appreciated.

Miheretab Alemu
  • 956
  • 2
  • 20
  • 43

4 Answers4

1

Make sure you added the extra dependency repositories:

mavenRepo "http://repo.grails.org/grails/libs-releases/"
mavenRepo "http://m2repo.spockframework.org/ext/"

to the maven repo section in BuildConfig. Seems like it can't find a dependency it needs (JodaTime in this case) Hope it helps.

Raanan W
  • 1,295
  • 7
  • 19
  • In fact I have done that and edited my question but doesn't resolve the error. – Miheretab Alemu Apr 30 '14 at 12:41
  • Checking the plugin source (https://github.com/jbarmash/grails-excel-import/), it doesn't define the Joda Time dependency, but needs it (ExcelImportService.goorvy). Try adding Joda Time ass a (maven) dependency and see if it works. The LocalDate class is missing, and should be somewhere in the classpath – Raanan W Apr 30 '14 at 13:34
  • Thanks I have found the solution. – Miheretab Alemu Apr 30 '14 at 13:43
1

just in case of someone need it. when i was in same trouble on grails 2.4.4 i use in my buildconfig: compile ":excel-import:2.0.0.BUILD-SNAPSHOT"

idiagne
  • 11
  • 9
0

I added plugins.joda-time=1.3.1 to application.properties and it is working now, I have found the solution here http://jonpolaski.blogspot.com/2013/04/grails-2x-excel-import-via-file-upload.html

Miheretab Alemu
  • 956
  • 2
  • 20
  • 43
0

You can add the following to dependencies to get the jodatime:

compile "org.jadira.usertype:usertype.jodatime:1.9"

However that still leaves issues with the excel-import:1.0.0

That import uses deprecated classes and won't compile with grails 2.4

There is a version named excel-import:1.0.1 which you can find on Git. Does anyone know how to install that?

josliber
  • 43,891
  • 12
  • 98
  • 133