Announcement Announcement Module
Collapse
No announcement yet.
STS 2.5.2 Grails Working Directory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.5.2 Grails Working Directory

    I need to change my Grails working directory from ~/.grails to /someotherdir

    I can do this in Grails by adding
    set JAVA_OPTS=%JAVA_OPTS% -Dgrails.work.dir="/someotherdir" in startGrails.

    This works fine if I build from the command line and the plugins are installed in /someotherdir

    When I view my project in STS, in the grails perspective, in the Project Explorer my plugins are missing from the plugins node. I am assuming that this is because it is still looking for them in ~/.grails. How do I update STS to use /someotherdir as the working directory?

    Thanks,
    Kim

  • #2
    Hi Kim,

    You could try setting that property in the STS preferences. Open workspace preferences, navigate to Groovy>Grails>GrailsLaunch on the left, then enter it on the right.

    You could also (although this is per project and not workspace wide):
    - set it in BuildConfig.groovy (this is discussed a little bit here: https://issuetracker.springsource.com/browse/STS-1296)
    - set it in a $HOME/.grails/settings.groovy (discussed here: http://jira.grails.org/browse/GRAILS-4117)

    If you have no luck getting it to work, feel free to raise a jira.

    regards
    Andy
    ---
    Andy Clement
    SpringSource Tool Suite Team

    Comment


    • #3
      Hi Andy,

      Setting the value in STS preferences and refreshing dependencies works a treat.



      Thanks,
      Kim

      Comment


      • #4
        I am just learning grails and trying to get Eclipse with STS working on a thumb driver. I set grails.work.dir in preferences, but I still get a ~/.ivy2 directory and need to be able to move it to another directory.

        Comment


        • #5
          Try setting -Divy.default.ivy.user.dir=/my/ivy/dir

          Regards,
          Kim

          Comment


          • #6
            I set grails.work.dir to \PortableApps\EclipsePortable\Data\workspace\.groo vy and that workes well. I set ivy.default.ivy.user.dir to \PortableApps\EclipsePortable\Data\workspace\.ivy2 and got an error stating that ivy needs an absolute path, so I set Ivy default to E:\PortableApps\EclipsePortable\Data\workspace\.iv y2 and everything works fine. If I move the thumb drive to a different computer all I have to do is change the Ivy default. I can live with that. Thank you for your help.

            Comment

            Working...
            X