Announcement Announcement Module
Collapse
No announcement yet.
jar dependencies for grails and sts Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • jar dependencies for grails and sts

    I'm totally new to grails,

    And I wanted to work on the tutorial. So I Downloaded Springsource toolsuite, from there installed grails and browsed the tutorial. However the tutorial uses joda time which is not available out of the box, so the compiler complains with "unable to resolve class DateTime". I'm not sure how groovy dependency management for external jars works but glancing over the documentation and the generated source tree I would expect that an entry 'compile ":joda-time:1.4"' in the dependencies section of the buildconfig.groovy file would do the trick. But that does not work. eclipse is not picking it up (the error remains and building the app with grails run-app fails with:

    "grailsCentral: bad organisation found in http://plugins.grails.org/grails-jod...-time-1.4.pom: expected='' found='org.grails.plugins")

    Which leads me to believe that the joda-time:1.4 is a plugin specifier.

    Even worse: my whole classpath -> grails dependencies is gone, only dsl-support> dsld remains.
    I hope somebody can shine a light on what I'm doing wrong, or where can I find additional documentation?

    Another option would be to use maven of course but I'm actually interested to see how grails is solving dependencies like this, apart from that I'm not that impressed with eclipse's maven support.

    Regards,
    Jeroen.

  • #2
    Try to make a .war file with "grails run-war" in the cmd. Then go to the target folder and rename myproject-0.1.war into myproject-0.1.zip. Open it go to WEB-INF/lib and look if there are your *.jar files in it. If they are not there, type "grails-clean" in the command wizard or in the command line and then "grails compile --refresh-dependencies" and then make again a war file. Then you must be able to see the jar files and it should work.

    Comment


    • #3
      Thanks for answer, I solved it the problem was probably
      • that i specified "compile" instead of "runtime" (as was indicated by the mysql example in the BuildConfig.groovy).
      • I had to specify it in a maven way: joda-time:joda-time:1.6.
      • STS was not picking up my classpath from BuildConfig for some unapparent reason *
      • my inexperience with grails, groovy and the whole stack,
      • I failed to see that the calendar application I was looking at, has a very nice git page with all the code, working out of the box like an A380.

      I'll keep your suggestion of inspecting the generated war** file in the back of my mind.
      * How do grails developers in general look at STS? I see almost all demo's done from command line and vi/emacs like text editors. And this 10 years after I got sacked at my first job for sticking with emacs and not using the company standard (MS) Developer suite

      ** With emacs you don't need to rename a war file to a zip file.

      Comment

      Working...
      X