Announcement Announcement Module
Collapse
No announcement yet.
Problem downloading plugins (joda-time specifically) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem downloading plugins (joda-time specifically)

    Still a relative newbie, so apologies if this is dumb...

    I'm trying to use joda-time plugin within STS 2.9.0.M2 / Grails 2.0.0.

    Once I setup JAVA_OPTS to use the corporate proxy, I managed to get the basic joda-time 1.3.1 POM to download by setting up the compile statement in BuildConfig.groovy

    I then added the usertype lines so that I could use LocalDate, but the editor reports an error.
    Code:
    import org.joda.time.*
    import org.jadira.usertype.dateandtime.joda.*
    
    class Interaction {
    	
    	LocalDate	when
    I setup another compile statement for the usertypes
    Code:
    repositories {
            inherits true // Whether to inherit repository definitions from plugins
            grailsPlugins()
            grailsHome()
            grailsCentral()
            mavenCentral()
    
            // uncomment these to enable remote dependency resolution from public Maven repositories
            //mavenCentral()
            //mavenLocal()
    		// GMR mavenRepo "http://repo1.maven.org"
            //mavenRepo "http://snapshots.repository.codehaus.org"
            //mavenRepo "http://repository.codehaus.org"
            //mavenRepo "http://download.java.net/maven/2/"
            //mavenRepo "http://repository.jboss.com/maven2/"
        }
        dependencies {
            // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
    
            // runtime 'mysql:mysql-connector-java:5.1.16'
        }
    
        plugins {
    		
            runtime ":hibernate:$grailsVersion"
            runtime ":jquery:1.7.1"
            runtime ":resources:1.1.5"
    		
            build ":tomcat:$grailsVersion"
    		
    		compile "org.jadira.usertype:usertype.jodatime:1.9"
    		compile ":joda-time:1.3.1"
        }
    and hoped that a "refresh dependencies" would sort things out, but this kicks off a search for zip files (whereas I'm guessing that the repositories have POMs.

    Code:
    	==== grailsPlugins: tried
    
    	  G:\GENERAL\dev\src\workspace-sts-2.9.0.M2\DiInteractions/lib/usertype.jodatime-1.9.zip
    
    	  C:\Documents and Settings\sys002.d037\.grails\2.0.0\projects\DiInteractions\plugins\hibernate-2.0.0/lib/usertype.jodatime-1.9.zip
    
    
    	==== grailsHome: tried
    
    	  G:\GENERAL\devenv\grails\grails-2.0.0/lib/org.jadira.usertype/usertype.jodatime/jars/usertype.jodatime-1.9.zip
    
    	==== grailsHome: tried
    
    	  G:\GENERAL\devenv\grails\grails-2.0.0\src\libs/usertype.jodatime-1.9.zip
    
    	==== grailsHome: tried
    
    	  G:\GENERAL\devenv\grails\grails-2.0.0\dist/usertype.jodatime-1.9.zip
    
    	==== grailsHome: tried
    
    	  C:\Documents and Settings\sys002.d037\.grails\2.0.0\cached-installed-plugins/usertype.jodatime-1.9.zip
    
    	==== grailsHome: tried
    
    	  G:\GENERAL\devenv\grails\grails-2.0.0/plugins/usertype.jodatime-1.9.zip
    
    	==== grailsCentral: tried
    
    	  http://plugins.grails.org/grails-usertype.jodatime/tags/RELEASE_1.9/grails-usertype.jodatime-1.9.zip
    
    	==== http://repo.grails.org/grails/plugins: tried
    
    	  http://repo.grails.org/grails/plugins/org/jadira/usertype/usertype.jodatime/1.9/usertype.jodatime-1.9.zip
    
    	==== http://repo.grails.org/grails/core: tried
    
    	  http://repo.grails.org/grails/core/org/jadira/usertype/usertype.jodatime/1.9/usertype.jodatime-1.9.zip
    
    	==== grailsCore: tried
    
    	  http://svn.codehaus.org/grails/trunk/grails-plugins/grails-usertype.jodatime/tags/RELEASE_1.9/grails-usertype.jodatime-1.9.zip
    
    	==== mavenCentral: tried
    
    	  http://repo1.maven.org/maven2/org/jadira/usertype/usertype.jodatime/1.9/usertype.jodatime-1.9.zip
    
    		::::::::::::::::::::::::::::::::::::::::::::::
    
    		::              FAILED DOWNLOADS            ::
    
    		:: ^ see resolution messages for details  ^ ::
    
    		::::::::::::::::::::::::::::::::::::::::::::::
    
    		:: org.jadira.usertype#usertype.jodatime;1.9!usertype.jodatime.zip
    
    		::::::::::::::::::::::::::::::::::::::::::::::
    
    
    | Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
    
    - org.jadira.usertype:usertype.jodatime:1.9
    1) Why is it looking for .zip instead of POM?

    2) what spell do I need to cast to make this work?

    Regards,

    Gordon

  • #2
    Hi I had the same problem because I read the doc too fast
    add one of the following dependencies to your application's
    so you need to have something like:
    Code:
    dependencies {
            compile("joda-time:joda-time-hibernate:1.3") {
            	excludes "joda-time", "hibernate"
            }
        }
    and
    Code:
        plugins {
            compile ":joda-time:1.4"
        }
    Hope this helps

    Comment


    • #3
      Thank you! That fixed my frustration...

      I used the following because v1.4 works with hibernate 4 and that isn't compatible with grails 2.0 (as far as I can acertain)
      Code:
      plugins {
          compile ":joda-time:1.3.1"
      }
      It seems like something has changed and you no longer need to import the jadira usertypes in your domain class (I tried with and without the import and it made now difference)
      Code:
      import org.joda.time.*
      //import org.jadira.usertype.dateandtime.joda.*

      Comment


      • #4
        Hi - I know this is a somewhat old thread but I am also having dependency issues with the joda-time plugin. Here's the setup:
        Code:
        IDE: GGTS 3.2.0
        Grails: 2.2.0
        Groovy: 2.0.7
        Java: 1.6.0_37
        and relevant snippets of BuildConfig.groovy:
        Code:
        plugins {
          compile ":joda-time:1.3.1"
        }
        
        dependencies{
          compile("joda-time:joda-time-hibernate:1.3") { excludes "joda-time", "hibernate" }
        
        }
        The project runs through refresh-dependencies just fine but when I go to run it I get:
        Code:
        Message: java.lang.NoClassDefFoundError: org/hibernate/engine/spi/SessionImplementor
           Line | Method
        ->> 757 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
        |   584 | beans                     in     ''
        |   527 | invokeMethod . . . . . .  in     ''
        |   303 | innerRun                  in java.util.concurrent.FutureTask$Sync
        |   138 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
        |   886 | runTask                   in java.util.concurrent.ThreadPoolExecutor$Worker
        |   908 | run . . . . . . . . . . . in     ''
        ^   662 | run                       in java.lang.Thread
        The only references to that Class I can find seem to refer to Hibernate version 4; I had thought that GORM was still based on version 3.

        Help!

        Comment

        Working...
        X